Example how to use SealBase Log
First step is to instrument the code using the LOG macro. If #NLOG compilation
flag is not enabled, #LOG() expands to code that will dump the output to
the logging device.
Usage:
LOG ( level, what , mode, expression)
- level: the level at and beyond which this output should
be dumped. Zero is the lowest level, and -1 is interpreted as "always".
- what: indicates the type of dump. The value should be either
trace, error or warning.
- mode: debugging mode flag. This indicates the context in which
this output was written. It can be one of the #logflag modes (usually starting
with @c LF), e.g., @c LFgeneral.
- expression: the expression to dump. It should be in the standard
stream insertion format; the first left shift operator is supplied by the
macro.
When you run the program you can define where to send the log messages
by setting the LOG environment variable.
For example:
- export LOG=stderr
# for sending
output to standard error
- export LOG=file:/tmp/myFile.log # to send
output to a file