7#ifndef __LOG_HEADER_GUARD__
8#define __LOG_HEADER_GUARD__
33#define LOG_SYSJRNL 100
35#if defined( __linux__ ) || defined( __sun )
41#include <sys/varargs.h>
74#define n_log( __LEVEL__ , ... ) \
77 _n_log( __LEVEL__ , __FILE__ , __func__ , __LINE__ , __VA_ARGS__ ); \
103void _n_log(
int level,
const char *file,
const char *func,
int line,
const char *format, ... ) ;
pthread_mutex_t LOG_MUTEX
mutex for thread-safe writting
FILE * get_log_file(void)
return the current log_file
int write_safe_log(TS_LOG *log, char *pat,...)
write to a thread-safe logging file
int open_safe_logging(TS_LOG **log, char *pathname, char *opt)
Open a thread-safe logging file.
char * open_sysjrnl(char *identity)
Open connection to syslog or create internals for event log.
void close_sysjrnl(void)
Close syslog connection or clean internals for event log.
int close_safe_logging(TS_LOG *log)
close a thread-safe logging file
int set_log_file(char *file)
Set the logging to a file instead of stderr.
void set_log_level(const int log_level)
Set the global log level value ( static int LOG_LEVEL )
void _n_log(int level, const char *file, const char *func, int line, const char *format,...)
Logging function.
int get_log_level(void)
Get the global log level value.
ThreadSafe LOGging structure.
Common headers and low-level hugly functions & define.