OpFlex Framework  1.7.0
Log Handler

A log message handler for the OpFlex framework. More...

Macros

#define LOG_TRACE   10
 Trace log level.
 
#define LOG_DEBUG4   20
 Debug4 (lowest debug) log level.
 
#define LOG_DEBUG3   30
 Debug 3 log level.
 
#define LOG_DEBUG2   40
 Debug 2 log level.
 
#define LOG_DEBUG1   50
 Debug 1 (highest debug) log level.
 
#define LOG_INFO   60
 Info log level.
 
#define LOG_WARNING   70
 Warning log level.
 
#define LOG_ERROR   80
 Error log level.
 
#define LOG_FATAL   90
 Fatal log level.
 

Typedefs

typedef void(* loghandler_p )(const char *file, int line, const char *function, int level, const char *message)
 Process a single log message. More...
 

Functions

ofstatus ofloghandler_register (int level, loghandler_p handler)
 Register a new log handler. More...
 

Detailed Description

A log message handler for the OpFlex framework.

You will need to create a log handler and register it if you want to want to log to your custom handler.

By default, the OpFlex Framework will simply log to standard out at INFO or above, but you can override this behavior by registering a customer log handler.

Typedef Documentation

typedef void(* loghandler_p)(const char *file, int line, const char *function, int level, const char *message)

Process a single log message.

This file is called synchronously from the thread that is doing the logging and is unsynchronized.

Parameters
filethe file that performs the logging
linethe line number for the log message
functionthe name of the function that's performing the logging
levelthe log level of the log message
messagethe formatted message to log

Function Documentation

ofstatus ofloghandler_register ( int  level,
loghandler_p  handler 
)

Register a new log handler.

Parameters
levelthe minimum log level for log messages that you want to recieve.
handlera function pointer to your handler function to be invoked when the listener is notified.
Returns
a status code