Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsLog Class Reference

#include <dsLog.h>

List of all members.

Public Types

enum  dsLogOpenFlags { LOG_OF_NONE = 0, LOG_OF_APPEND = 1, LOG_OF_TRUNCATE = 2, LOG_OF_ROTATE = 4 }

Public Methods

 dsLog (long mode, char *logname, dsLogOpenFlags openflags=LOG_OF_APPEND)
 ~dsLog ()
int mode (int mode=-1)
void log (int mode, const char *format,...)
void log (int mode, dsStrstream &inmsg)
void vlog (int mode, const char *format, va_list ap)

Protected Methods

void rotate (char *logname)

Protected Attributes

int _mode
char * _fname
int _fd
dsLogOpenFlags _openflags

Detailed Description

Intellectual logging routine

Member Enumeration Documentation

enum dsLog::dsLogOpenFlags

This enum controls how to deal with existing log.

Enumeration values:
LOG_OF_NONE  Really not used
LOG_OF_APPEND  Append data to existing logfile
LOG_OF_TRUNCATE  Truncate existing logfile
LOG_OF_ROTATE  Rename existing logfile to logfile_nnn

Constructor & Destructor Documentation

dsLog::dsLog long    mode,
char *    logname,
dsLogOpenFlags    openflags = LOG_OF_APPEND

Create instance

  • mode bitwise mask
  • logname name of file to log to "stderr" and "stdout" recognised.
  • opnflags see enum dsLogOpenFlags


Member Function Documentation

void dsLog::log int    mode,
dsStrstream   inmsg

void dsLog::log int    mode,
const char *    format,

write log line. log file is reopened for each call. copy data to UDP socket if udp data is set.

  • mode bitwaise mask should match mode specified in constructor 0xFF - LOG_ALWAYS, 0 - LOG_NONE
  • format see printf

int dsLog::mode int    mode = -1 [inline]

set/get current log mask

void dsLog::rotate char *    logname [protected]

void dsLog::vlog int    mode,
const char *    format,
va_list    ap

Member Data Documentation

int dsLog::_fd [protected]

char* dsLog::_fname [protected]

int dsLog::_mode [protected]

dsLogOpenFlags dsLog::_openflags [protected]

The documentation for this class was generated from the following files:
Generated on Mon May 16 18:27:00 2005 for libdms4 by doxygen1.3-rc2