log.h File Reference

#include <sys/time.h>
#include <time.h>
#include <stdio.h>
#include <syslog.h>
#include "testrunnerlite.h"

Go to the source code of this file.

Defines

#define LOG_MSG_MAX_SIZE   2048
#define LOG_MSG(__level__, __format__, __args__...)
#define LOG_TYPES_COUNT   LOG_DEBUG + 1

Enumerations

enum  log_levels { LOG_LEVEL_SILENT = 0, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVELS_COUNT }

Functions

void log_msg (int type, const char *file, const char *function, int lineno, char *format,...)
void log_init (testrunner_lite_options *opts)
void log_close (void)


Define Documentation

#define LOG_MSG ( __level__,
__format__,
__args__...   ) 

Value:

do{                                                             \
                log_msg (__level__, __FILE__, __FUNCTION__, __LINE__,   \
                         __format__, ##__args__);                       \
        } while (0)

Definition at line 40 of file log.h.

#define LOG_MSG_MAX_SIZE   2048

Definition at line 36 of file log.h.

#define LOG_TYPES_COUNT   LOG_DEBUG + 1

Definition at line 45 of file log.h.


Enumeration Type Documentation

enum log_levels

Enumerator:
LOG_LEVEL_SILENT 
LOG_LEVEL_INFO 
LOG_LEVEL_DEBUG 
LOG_LEVELS_COUNT 

Definition at line 58 of file log.h.


Function Documentation

void log_close ( void   ) 

Closes the log, flush stdout and cleanup curl if it's in use

Definition at line 354 of file log.c.

void log_init ( testrunner_lite_options opts  ) 

Sets the verbosity level

Parameters:
opts testrunner lite options

Definition at line 321 of file log.c.

void log_msg ( int  type,
const char *  file,
const char *  function,
int  lineno,
char *  format,
  ... 
)

Prints a log message to stdout in format "[LOG_TYPE] HH:MM:SS message" Usage is the same as in regular printf(), except the first parameter Example: log_msg (LOG_ERR, "Error message %s\n", "Failure");

Parameters:
type Log type defined in log_message_types enum
file Source file name the log entry corresponds to
function Function emitting the log
lineno Line number
format Message format

Definition at line 192 of file log.c.


Generated on Tue Jul 27 01:28:56 2010 for testrunner-lite by  doxygen 1.5.6