hl7parse
Macros | Functions | Variables
logging.h File Reference

logging functioins and macros More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LEVEL_FATAL   1
 
#define LEVEL_CRITICAL   2
 
#define LEVEL_ERROR   3
 
#define LEVEL_WARNING   4
 
#define LEVEL_NOTICE   5
 
#define LEVEL_INFO   6
 
#define LEVEL_DEBUG   7
 
#define LEVEL_TRACE   8
 
#define log_fatal(fmt, ...)
 log fatal More...
 
#define log_critical(fmt, ...)
 log critical More...
 
#define log_error(fmt, ...)
 log error More...
 
#define log_warning(fmt, ...)
 log warning More...
 
#define log_notice(fmt, ...)
 log notice More...
 
#define log_info(fmt, ...)
 log info More...
 
#define log_debug(fmt, ...)
 log debug More...
 
#define log_trace(fmt, ...)
 log trace More...
 

Functions

void logprint (const char *fmt,...)
 log function More...
 
const char * logtime (void)
 create timestamp More...
 

Variables

const int loglevel
 global log level More...
 

Detailed Description

logging functioins and macros

if the macro PRODUCTION is set, all log functions will output nothing.

Macro Definition Documentation

◆ LEVEL_CRITICAL

#define LEVEL_CRITICAL   2

log elvel critical

◆ LEVEL_DEBUG

#define LEVEL_DEBUG   7

log elvel debugging

◆ LEVEL_ERROR

#define LEVEL_ERROR   3

log elvel error

◆ LEVEL_FATAL

#define LEVEL_FATAL   1

log elvel fatal

◆ LEVEL_INFO

#define LEVEL_INFO   6

log elvel info

◆ LEVEL_NOTICE

#define LEVEL_NOTICE   5

log elvel notice

◆ LEVEL_TRACE

#define LEVEL_TRACE   8

log elvel trace

◆ LEVEL_WARNING

#define LEVEL_WARNING   4

log elvel warning

◆ log_critical

#define log_critical (   fmt,
  ... 
)
Value:
logprint("%s %s:%d " fmt "\n", \
logtime(), __FUNCTION__, __LINE__, ##__VA_ARGS__)
void logprint(const char *fmt,...)
log function
Definition: logging.c:13
const char * logtime(void)
create timestamp
Definition: logging.c:21

log critical

Parameters
[in]fmtformat
[in]...arguments

◆ log_debug

#define log_debug (   fmt,
  ... 
)
Value:
logprint("%s %s:%d " fmt "\n", logtime(), __FUNCTION__, \
__LINE__, ##__VA_ARGS__)
#define LEVEL_DEBUG
Definition: logging.h:21
const int loglevel
global log level
Definition: 7compose.c:15
const char * logtime(void)
create timestamp
Definition: logging.c:21

log debug

Parameters
[in]fmtformat
[in]...arguments

◆ log_error

#define log_error (   fmt,
  ... 
)
Value:
logprint("%s %s:%d " fmt "\n", \
logtime(), __FUNCTION__, __LINE__, ##__VA_ARGS__)
void logprint(const char *fmt,...)
log function
Definition: logging.c:13
const char * logtime(void)
create timestamp
Definition: logging.c:21

log error

Parameters
[in]fmtformat
[in]...arguments

◆ log_fatal

#define log_fatal (   fmt,
  ... 
)
Value:
logprint("%s %s:%d " fmt "\n", \
logtime(), __FUNCTION__, __LINE__, ##__VA_ARGS__)
void logprint(const char *fmt,...)
log function
Definition: logging.c:13
const char * logtime(void)
create timestamp
Definition: logging.c:21

log fatal

Parameters
[in]fmtformat
[in]...arguments

◆ log_info

#define log_info (   fmt,
  ... 
)
Value:
logprint("%s %s:%d " fmt "\n", logtime(), __FUNCTION__, \
__LINE__, ##__VA_ARGS__)
#define LEVEL_INFO
Definition: logging.h:19
const int loglevel
global log level
Definition: 7compose.c:15
const char * logtime(void)
create timestamp
Definition: logging.c:21

log info

Parameters
[in]fmtformat
[in]...arguments

◆ log_notice

#define log_notice (   fmt,
  ... 
)
Value:
logprint("%s %s:%d " fmt "\n", logtime(), __FUNCTION__, \
__LINE__, ##__VA_ARGS__)
#define LEVEL_NOTICE
Definition: logging.h:17
const int loglevel
global log level
Definition: 7compose.c:15
const char * logtime(void)
create timestamp
Definition: logging.c:21

log notice

Parameters
[in]fmtformat
[in]...arguments

◆ log_trace

#define log_trace (   fmt,
  ... 
)
Value:
logprint("%s %s:%d " fmt "\n", logtime(), __FUNCTION__, \
__LINE__, ##__VA_ARGS__)
const int loglevel
global log level
Definition: 7compose.c:15
#define LEVEL_TRACE
Definition: logging.h:23
const char * logtime(void)
create timestamp
Definition: logging.c:21

log trace

Parameters
[in]fmtformat
[in]...arguments

◆ log_warning

#define log_warning (   fmt,
  ... 
)
Value:
logprint("%s %s:%d " fmt "\n", logtime(), __FUNCTION__, \
__LINE__, ##__VA_ARGS__)
#define LEVEL_WARNING
Definition: logging.h:15
const int loglevel
global log level
Definition: 7compose.c:15
const char * logtime(void)
create timestamp
Definition: logging.c:21

log warning

Parameters
[in]fmtformat
[in]...arguments

Function Documentation

◆ logprint()

void logprint ( const char *  fmt,
  ... 
)

log function

This method is a drop in replacement for printf()

See also
sprintf()
Parameters
fmtformat according to sprintf()

◆ logtime()

const char* logtime ( void  )

create timestamp

Returns
current time in "%Y-%m-%d %H:%M:%S"

Variable Documentation

◆ loglevel

const int loglevel

global log level

must be declared in main program

global log level