libcomps  ..
 All Data Structures Files Functions Variables Typedefs
Data Structures | Enumerations | Functions
comps_logger.h File Reference

A Documented file. Details. More...

#include "comps_list.h"
#include "comps_elem.h"
#include "comps_types.h"

Go to the source code of this file.

Data Structures

struct  COMPS_LoggerEntry
 
struct  COMPS_Logger
 

Enumerations

enum  COMPS_LogEntryType { COMPS_LOG_INFO, COMPS_LOG_ERROR, COMPS_LOG_WARNING }
 
enum  COMPS_LogErrCode {
  COMPS_ERR_NO_ERR, COMPS_ERR_ELEM_UNKNOWN, COMPS_ERR_ELEM_ALREADYSET, COMPS_ERR_PARSER,
  COMPS_ERR_DEFAULT_PARAM, COMPS_ERR_USERVISIBLE_PARAM, COMPS_ERR_PACKAGE_UNKNOWN, COMPS_ERR_DEFAULT_MISSING,
  COMPS_ERR_USERVISIBLE_MISSING, COMPS_ERR_NAME_MISSING, COMPS_ERR_ID_MISSING, COMPS_ERR_DESC_MISSING,
  COMPS_ERR_GROUPIDS_EMPTY, COMPS_ERR_DTD_ELEM, COMPS_ERR_DTD_SEQUENCE, COMPS_ERR_DTD_ATTRS,
  COMPS_ERR_DTD_NOCHILD, COMPS_ERR_MALLOC, COMPS_ERR_READFD, COMPS_ERR_WRITEF,
  COMPS_ERR_XMLGEN, COMPS_ERR_NOPARENT, COMPS_ERR_GROUPLIST_NOTSET, COMPS_ERR_OPTIONLIST_NOTSET,
  COMPS_ERR_ELEM_REQUIRED, COMPS_ERR_LIST_EMPTY, COMPS_ERR_TEXT_BETWEEN, COMPS_ERR_NOCONTENT
}
 

Functions

COMPS_Loggercomps_log_create (unsigned redirect2out)
 
void comps_log_destroy (COMPS_Logger *log)
 
COMPS_LoggerEntrycomps_log_entry_create (const char *msg, unsigned type, COMPS_LogErrCode code, unsigned int optcode1, unsigned int optcode2, unsigned int optcode3)
 
char * comps_log_entry_str (COMPS_LoggerEntry *entry)
 
void comps_log_error (COMPS_Logger *logger, const char *msg, COMPS_LogErrCode code, unsigned int optcode1, unsigned int optcode2, unsigned int optcode3)
 
void comps_log_warning (COMPS_Logger *logger, const char *msg, COMPS_LogErrCode code, unsigned int optcode1, unsigned int optcode2, unsigned int optcode3)
 
void comps_log_info (COMPS_Logger *logger, const char *msg, COMPS_LogErrCode code, unsigned int optcode1, unsigned int optcode2, unsigned int optcode3)
 
void comps_log_entry_destroy (COMPS_LoggerEntry *entry)
 
void comps_log_entry_destroy_v (void *entry)
 
char * comps_log_str (COMPS_Logger *logger)
 

Detailed Description

A Documented file. Details.

Function Documentation

COMPS_Logger* comps_log_create ( unsigned  redirect2output)

COMPS_Logger constructor

Parameters
redirect2outputif set to non-zero, log messages will be printed to stdout/stderr
Returns
COMPS_Logger object
void comps_log_destroy ( COMPS_Logger log)

COMPS_Logger destructor

Parameters
logCOMPS_Logger object
COMPS_LoggerEntry* comps_log_entry_create ( const char *  msg,
unsigned  type,
COMPS_LogErrCode  code,
unsigned int  optcode1,
unsigned int  optcode2,
unsigned int  optcode3 
)

Logger entry constructor

Parameters
msgoptional log entry message
typelog type(info,warning,error)
codeerrno of log entry
optcode1optional log entry code 1
optcode2optional log entry code 2
optcode3optional log entry code 3
Returns
COMPS_LoggerEntry object
char* comps_log_entry_str ( COMPS_LoggerEntry entry)

Return string representation of logger entry message. Returned string need to be freed

Parameters
entryCOMPS_LoggerEntry object
Returns
string representation of log entry
void comps_log_error ( COMPS_Logger log,
const char *  msg,
COMPS_LogErrCode  code,
unsigned int  optcode1,
unsigned int  optcode2,
unsigned int  optcode3 
)

Log new error message

Parameters
logCOMPS_Logger object
msgoptional log entry message
codeerrno of log entry
optcode1optional log entry code 1
optcode2optional log entry code 2
optcode3optional log entry code 3
void comps_log_info ( COMPS_Logger log,
const char *  msg,
COMPS_LogErrCode  code,
unsigned int  optcode1,
unsigned int  optcode2,
unsigned int  optcode3 
)

Log new info message

Parameters
logCOMPS_Logger object
msgoptional log entry message
codeerrno of log entry
optcode1optional log entry code 1
optcode2optional log entry code 2
optcode3optional log entry code 3
char* comps_log_str ( COMPS_Logger logger)

Return string representaiton of all log entries. Returned string need to be freed

Parameters
loggerCOMPS_Logger object
Returns
string representation of log entries
void comps_log_warning ( COMPS_Logger log,
const char *  msg,
COMPS_LogErrCode  code,
unsigned int  optcode1,
unsigned int  optcode2,
unsigned int  optcode3 
)

Log new warning message

Parameters
logCOMPS_Logger object
msgoptional log entry message
codeerrno of log entry
optcode1optional log entry code 1
optcode2optional log entry code 2
optcode3optional log entry code 3