xHarbour Reference Documentation > Command Reference |
Sends a message to open log channels.
LOG <data,...> ; [PRIORITY CRITICAL | DEBUG | DEFAULT | ERROR | INFO | WARNING ]
The LOG command accepts a comma separated list of values and creates from it a log message. This log message is sent to all log channels previously opened with the INIT LOG command. If the PRIORITY option is omitted, the priority assigned to each log channel is used. If a PRIORITY keyword is specified, the log message is only received by a log channel when the PRIORITY of this LOG message is equal or higher than the priority of the log channel.
See also: | CLOSE LOG, INIT LOG, SET LOG STYLE, TraceLog() |
Category: | Log commands , xHarbour extensions |
Header: | hblog.ch |
Source: | rtl\hblog.prg |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example displays log messages of all priorities to the console, // but logs only CRITICAL and ERROR messages to the Testlog.log file. #include "Hblog.ch" PROCEDURE Main INIT LOG Console() ; File( HB_LOG_ERROR , "Testlog.log" ) LOG "CRITICAL" PRIORITY CRITICAL LOG "ERROR" PRIORITY ERROR LOG "WARNING" PRIORITY WARNING LOG "INFO" PRIORITY INFO LOG "DEBUG" PRIORITY DEBUG CLOSE LOG RETURN
http://www.xHarbour.com