Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

look::DbLogger Class Reference

Log database activity. More...

#include <dblog.h>

List of all members.

Static Public Methods

void StartLogging (const LookString &theFileName="")
 Start logging. More...

void StopLogging (void)
 Stop logging.

void Log (LookString theString)
 Log a string. More...

void Log (const char *fmt,...)
 Varargs version of logging. More...

void TimeLog (LookString theString)
void TimeLog (const char *fmt,...)
void TimeStart (void)
 Start internal stopwatch.

void TimeStop (void)
 Stop internal stopwatch and put time to file. More...

LookString GetLogFileName (void)
 Get the log file name. More...

bool IsLogging (void)

Static Protected Attributes

LookString itsLogFileName
bool itIsLogging = false
double itsTimeStart = 0.0


Detailed Description

Log database activity.

The log goes to a specified file.

This can also time things.

Note all logging is fopen/fprintf/fclose - the log file is thus readable by other programs immediately but the opening/closing may be slow, especially for a lot of small operations.


Member Function Documentation

LookString look::DbLogger::GetLogFileName ( void ) [static]
 

Get the log file name.

This is maintained over calls to StartLogging() and StopLogging()

void look::DbLogger::Log ( const char * fmt,
... ) [static]
 

Varargs version of logging.

If it is logging, appends the string formed from fmt and any other parameters to the log file. The resulting string _must_ be < 4096 bytes long.

Parameters:
fmt   printf style format

void look::DbLogger::Log ( LookString theString ) [static]
 

Log a string.

If it is logging, appends theString to the log file.

Parameters:
theString  

void look::DbLogger::StartLogging ( const LookString & theFileName = "" ) [static]
 

Start logging.

Parameters:
theFileName   The file to log to.

void look::DbLogger::TimeStop ( void ) [static]
 

Stop internal stopwatch and put time to file.

A message of the form "Finished 11-Jan-2001 10:45:54 Took 5.43
" is logged.


The documentation for this class was generated from the following files:
Generated at Thu Jan 17 12:53:08 2002 for liblookdb by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001