Logging functionality


Typedefs

typedef ix_log_s ix_log_t

Enumerations

enum  ix_verbose_e { IX_V_LOG = 0x000, IX_V_ERROR = 0x001, IX_V_PLAIN = 0x80000000, IX_V_ALL = 0xFFFFFFFF }

Functions

void ix_log (unsigned long flag, char *text,...)
void ix_log_level (unsigned long int mask)
unsigned long int ix_log_getlevel (void)
void ix_log_name (char *name)
void ix_log_node (int node)
void ix_log_sys (int flag)
int ix_log_getsys (void)
ix_log_tix_logfac_new (char *facility, unsigned long int errlevel)
void ix_logfac_free (ix_log_t *plog)
void ix_logfac_log (ix_log_t *plog, unsigned long flag, char *text,...)
void ix_logfac_level (ix_log_t *plog, unsigned long int mask)
unsigned long int ix_logfac_getlevel (ix_log_t *plog)
int ix_log_mask64 (uint64_t v, char *buffer, int len)
int ix_log_mask32 (uint32_t v, char *buffer, int len)
int ix_snprint (char *buffer, size_t buflen, char *str)
int ix_hexnprint (char *buf, size_t buflen, unsigned char *byte, size_t len)

Detailed Description

This module describe the methods to set loging types and print loging messages

Typedef Documentation

typedef struct ix_log_s ix_log_t

log facility object


Enumeration Type Documentation

enum ix_verbose_e

pre-defined global log levels: The log-messages with level IX_V_LOG or IX_V_ERROR are always logged, you have to add your own log levels 0x002, 0x004, 0x008,0x010, 0x020,... and set the desired log mask with ix_log_level()

Enumerator:
IX_V_LOG  log message
IX_V_ERROR  log message with special prompt
IX_V_PLAIN  log just text, don't use arguments


Function Documentation

int ix_hexnprint ( char *  buf,
size_t  buflen,
unsigned char *  byte,
size_t  len 
)

Utility function for logging, prints an array of bytes as hexadecimal output to buffer

Parameters:
buf buffer to print to
buflen sizeof of buffer
byte array of bytes
len length of byte array
Returns:
number of written bytes

void ix_log ( unsigned long  flag,
char *  text,
  ... 
)

The log message text is logged if flag is set in log_level mask (see ix_log_level()). The text may contain printf format specifier corresponding to the arguments

Parameters:
flag log level of log message
text log message

unsigned long int ix_log_getlevel ( void   ) 

gets loglevel

Returns:
active log level mask

int ix_log_getsys ( void   ) 

get syslog enable flag

Returns:
  • 0 syslog output is disabled
  • 1 syslog output is enabled

void ix_log_level ( unsigned long int  mask  ) 

sets loglevel to mask

Parameters:
mask loglevel to set

int ix_log_mask32 ( uint32_t  v,
char *  buffer,
int  len 
)

Utility function for logging, print 64 bit v as bitpattern to buffer

Parameters:
v 
buffer 
len sizeof buffer
Returns:
number of written characters

int ix_log_mask64 ( uint64_t  v,
char *  buffer,
int  len 
)

Utility function for logging, print 32 bit v as bitpattern to buffer

Parameters:
v 
buffer 
len sizeof buffer
Returns:
number of written characters

void ix_log_name ( char *  name  ) 

sets caption name for log messages

Parameters:
name caption name

void ix_log_node ( int  node  ) 

sets caption node number for log messages

Parameters:
node node number

void ix_log_sys ( int  flag  ) 

enables logging via syslogd

Parameters:
flag 
  • 0 disables syslog
  • 1 enables syslog plus output to stderr
  • 2 enables syslog (no other output)

void ix_logfac_free ( ix_log_t plog  ) 

close a local loging group and free all resources

unsigned long int ix_logfac_getlevel ( ix_log_t plog  ) 

get log facility log level: see ix_log_level()

Parameters:
plog log facility object
Returns:
log level for log facility

void ix_logfac_level ( ix_log_t plog,
unsigned long int  mask 
)

set log facility log level: see ix_log_level()

Parameters:
plog log facility object
mask loglevel to set

void ix_logfac_log ( ix_log_t plog,
unsigned long  flag,
char *  text,
  ... 
)

log facility log-function: see ix_log()

Parameters:
plog log facility object
flag log level of log message
text log message

ix_log_t* ix_logfac_new ( char *  facility,
unsigned long int  errlevel 
)

create a local loging facility

Parameters:
facility caption for log messages under this group
errlevel level which is considered to present the error messages
Returns:
  • handle for loging group
  • null: error

int ix_snprint ( char *  buffer,
size_t  buflen,
char *  str 
)

Utility function for logging, prints the string str to buffer

Parameters:
buffer 
buflen sizeof of buffer
str 
Returns:
number of written bytes


Generated on 4 Mar 2014 for ixtools by  doxygen 1.4.7