C library for SOAP (Simple Object Access Protocol)


Logging interface
[nanoHTTP]


Modules

 Commandline flags

Defines

#define NANOHTTP_LOG_LEVEL_OFF_STRING   "OFF"
#define NANOHTTP_LOG_LEVEL_VERBOSE_STRING   "VERBOSE"
#define NANOHTTP_LOG_LEVEL_DEBUG_STRING   "DEBUG"
#define NANOHTTP_LOG_LEVEL_INFO_STRING   "INFO"
#define NANOHTTP_LOG_LEVEL_WARN_STRING   "WARN"
#define NANOHTTP_LOG_LEVEL_ERROR_STRING   "ERROR"
#define NANOHTTP_LOG_LEVEL_FATAL_STRING   "FATAL"
#define NANOHTTP_LOG_LEVEL_UNKNOWN_STRING   "UNKNOWN"
#define NANOHTTP_LOG_DISABLED   0x00
#define NANOHTTP_LOG_FOREGROUND   0x01
#define NANOHTTP_LOG_SYSLOG   0x02
#define log_verbose(fmt,...)
#define log_debug(fmt,...)
#define log_info(fmt,...)
#define log_warn(fmt,...)
#define log_error(fmt,...)
#define log_fatal(fmt,...)

Typedefs

typedef enum nanohttp_loglevel nanohttp_loglevel_t

Enumerations

enum  nanohttp_loglevel {
  NANOHTTP_LOG_OFF, NANOHTTP_LOG_VERBOSE, NANOHTTP_LOG_DEBUG, NANOHTTP_LOG_INFO,
  NANOHTTP_LOG_WARN, NANOHTTP_LOG_ERROR, NANOHTTP_LOG_FATAL
}

Functions

nanohttp_loglevel_t nanohttp_log_set_loglevel (nanohttp_loglevel_t level)
nanohttp_loglevel_t nanohttp_log_get_loglevel (void)
void nanohttp_log_set_logfile (const char *filename)
const char * nanohttp_log_get_logfile (void)
int nanohttp_log_set_logtype (int type)

Define Documentation

#define log_debug ( fmt,
...   ) 

Value:

_nanohttp_log_printf(NANOHTTP_LOG_DEBUG, \
                             NANOHTTP_LOG_LEVEL_DEBUG_STRING " %s: " fmt "\n", \
                             __FUNCTION__, ## __VA_ARGS__)

#define log_error ( fmt,
...   ) 

Value:

_nanohttp_log_printf(NANOHTTP_LOG_ERROR, \
                             NANOHTTP_LOG_LEVEL_ERROR_STRING " %s: " fmt "\n", \
                             __FUNCTION__, ## __VA_ARGS__)

#define log_fatal ( fmt,
...   ) 

Value:

_nanohttp_log_printf(NANOHTTP_LOG_FATAL, \
                             NANOHTTP_LOG_LEVEL_FATAL_STRING " %s: " fmt "\n", \
                             __FUNCTION__, ## __VA_ARGS__)

#define log_info ( fmt,
...   ) 

Value:

_nanohttp_log_printf(NANOHTTP_LOG_INFO, \
                             NANOHTTP_LOG_LEVEL_INFO_STRING " %s: " fmt "\n", \
                             __FUNCTION__, ## __VA_ARGS__)

#define log_verbose ( fmt,
...   ) 

Value:

_nanohttp_log_printf(NANOHTTP_LOG_VERBOSE, \
                             NANOHTTP_LOG_LEVEL_VERBOSE_STRING " %s: " fmt "\n", \
                             __FUNCTION__, ## __VA_ARGS__)

#define log_warn ( fmt,
...   ) 

Value:

_nanohttp_log_printf(NANOHTTP_LOG_WARN, \
                             NANOHTTP_LOG_LEVEL_WARN_STRING " %s: " fmt "\n", \
                             __FUNCTION__, ## __VA_ARGS__)

#define NANOHTTP_LOG_DISABLED   0x00

Logging disabled

#define NANOHTTP_LOG_FOREGROUND   0x01

Logging to stdout enabled

#define NANOHTTP_LOG_LEVEL_DEBUG_STRING   "DEBUG"

#define NANOHTTP_LOG_LEVEL_ERROR_STRING   "ERROR"

#define NANOHTTP_LOG_LEVEL_FATAL_STRING   "FATAL"

#define NANOHTTP_LOG_LEVEL_INFO_STRING   "INFO"

#define NANOHTTP_LOG_LEVEL_OFF_STRING   "OFF"

#define NANOHTTP_LOG_LEVEL_UNKNOWN_STRING   "UNKNOWN"

#define NANOHTTP_LOG_LEVEL_VERBOSE_STRING   "VERBOSE"

#define NANOHTTP_LOG_LEVEL_WARN_STRING   "WARN"

#define NANOHTTP_LOG_SYSLOG   0x02

Syslog logging enabled


Typedef Documentation

Loglevel definition


Enumeration Type Documentation

Loglevel definition

Enumerator:
NANOHTTP_LOG_OFF  Logging completely turned off (use at your own risk).
NANOHTTP_LOG_VERBOSE  Debugging messages that may overflow the log
NANOHTTP_LOG_DEBUG  Message that contain information normally of use only when debugging the library
NANOHTTP_LOG_INFO  Informaional messages
NANOHTTP_LOG_WARN  Warning messages
NANOHTTP_LOG_ERROR  A condition that should be corrected immediately, such as a broken network connection
NANOHTTP_LOG_FATAL  A panic condition


Function Documentation

const char* nanohttp_log_get_logfile ( void   ) 

This function returns the filename of the current logfile.

Returns:
Pointer to the filename or NULL otherwise.

nanohttp_loglevel_t nanohttp_log_get_loglevel ( void   ) 

This function returns the current loglevel.

Returns:
The current loglevel.

void nanohttp_log_set_logfile ( const char *  filename  ) 

This function set the name of a logfile.

Parameters:
filename The filename of the logfile.

nanohttp_loglevel_t nanohttp_log_set_loglevel ( nanohttp_loglevel_t  level  ) 

This function sets a new the loglevel and returns the previous one.

Parameters:
level The new loglevel.
Returns:
The old loglevel.

int nanohttp_log_set_logtype ( int  type  ) 

This function sets the type of logging

Returns:
The old logtype.
See also:
- NANOHTTP_LOG_DISABLED


csoap project homepage: http://csoap.sourceforge.net