smf_trace.h File Reference

Logging functions. More...

Go to the source code of this file.

Macros

#define TRACE(level, fmt...)   trace(level, THIS_MODULE, __func__, __LINE__, NULL, fmt)
 Convenience macro for logging.
 
#define STRACE(level, sid, fmt...)   trace(level, THIS_MODULE, __func__, __LINE__, sid, fmt)
 Log message with session id.
 
#define TRDEBUG(fmt,...)   TRACE(TRACE_DEBUG, fmt, ##__VA_ARGS__)
 Shortcut for logging with debug log level.
 
#define TRINFO(fmt,...)   TRACE(TRACE_INFO, fmt, ##__VA_ARGS__)
 Shortcut for logging with info log level.
 
#define TRNOTICE(fmt,...)   TRACE(TRACE_NOTICE, fmt, ##__VA_ARGS__)
 Shortcut for logging with notice log level.
 
#define TRWARN(fmt,...)   TRACE(TRACE_WARNING, fmt, ##__VA_ARGS__)
 Shortcut for logging with warning log level.
 
#define TRERR(fmt,...)   TRACE(TRACE_ERR, fmt, ##__VA_ARGS__)
 Shortcut for logging with error log level.
 
#define TRCRIT(fmt,...)   TRACE(TRACE_CRIT, fmt, ##__VA_ARGS__)
 Shortcut for logging with critical log level.
 
#define TRALERT(fmt,...)   TRACE(TRACE_ALERT, fmt, ##__VA_ARGS__)
 Shortcut for logging with alert log level.
 
#define TREMERG(fmt,...)   TRACE(TRACE_EMERG, fmt, ##__VA_ARGS__)
 Shortcut for logging with ermegency log level.
 

Enumerations

enum  SMFTrace_T {
  TRACE_EMERG = 1, TRACE_ALERT = 2, TRACE_CRIT = 4, TRACE_ERR = 8,
  TRACE_WARNING = 16, TRACE_NOTICE = 32, TRACE_INFO = 64, TRACE_DEBUG = 128,
  TRACE_LOOKUP = 256
}
 Possible log levels.
 
enum  SMFTraceDest_T { TRACE_DEST_SYSLOG, TRACE_DEST_STDERR }
 Trace destination.
 

Functions

void configure_debug (int debug)
 Configures the detail-level of a trace-entry.
 
void configure_trace_destination (SMFTraceDest_T dest)
 Configures the destination, where all the log-data are send to.
 

Detailed Description

Logging functions.

Macro Definition Documentation

#define TRACE (   level,
  fmt... 
)    trace(level, THIS_MODULE, __func__, __LINE__, NULL, fmt)

Convenience macro for logging.

Parameters
levelloglevel, see trace_t
fmtformat string for log message
...format string arguments

Function Documentation

void configure_debug ( int  debug)

Configures the detail-level of a trace-entry.

Parameters
debugIf set to 1, then the function and line-number are logged in in addition
void configure_trace_destination ( SMFTraceDest_T  dest)

Configures the destination, where all the log-data are send to.

Parameters
destThe new logging-destination. The default is TRACE_DEST_SYSLOG.