xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

LOG

Sends a message to open log channels.

Syntax

LOG <data,...> ;
[PRIORITY CRITICAL |
             DEBUG |
           DEFAULT |
             ERROR |
              INFO |
           WARNING ]

Arguments

<data,...>
A comma separated list of arbitrary data to send as message to the open log channels.
PRIORITY
Optionally, the priority of this log message can be specified using one of the keywords CRITICAL, DEBUG, DEFAULT, ERROR, INFO or WARNING.

Description

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.

Info

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

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe