general/log.cc File Reference

#include <stdio.h>
#include <iostream>
#include <sstream>
#include "log.h"
#include "util.h"
#include "hashtable.h"

Defines

#define DEBUG_ROUTINE   "log"

Functions

void dbg_init (const char *file)
 Open the logfile.
void dbg_relink ()
std::string dbg_time ()
void dbg_log (const int prio, const char *routine, const char *format,...)
 Log something.
void dbg_level (const int prio, const char *routine)
 Set the debug level for a routine.

Variables

FILE * log_file = stderr
int dbg_genlevel = 0
hashtable< const
char, int > 
dbg_hash (100)
string dbg_filename
std::string month []

Define Documentation

#define DEBUG_ROUTINE   "log"


Function Documentation

void dbg_init ( const char *  file  ) 

Open the logfile.

When not called or on a failure stderr will be used for logging.

Parameters:
file The logfile to open

void dbg_level ( const int  prio,
const char *  routine 
)

Set the debug level for a routine.

Parameters:
prio The priority of messages that will be show, higher means more detailed logging.
routine The debug name of the routine as defined at the start of the .cc file usually its name.
A NULL will result in setting the general debug level for every routine that has no specific level set.

void dbg_log ( const int  prio,
const char *  routine,
const char *  format,
  ... 
)

Log something.

Prefer the marcro's above this function for smaller code on a low DEBUG_LEVEL

Parameters:
prio the priority of this log message
routine the routine where this code is a part of
format a ANSI-C style format string
... parameters used with the format string

void dbg_relink (  ) 

std::string dbg_time (  ) 


Variable Documentation

string dbg_filename

int dbg_genlevel = 0

hashtable<const char,int> dbg_hash(100)

FILE* log_file = stderr

std::string month[]

Initial value:

 {
    "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}



Generated on Tue Jan 1 17:30:01 2008 for general/log.cc File Reference by  doxygen   Visit the project page on SourceForge.net Logo