Defined in file: hzProcess.h

The hzLogger class manages a 'log channel'. Instead of writing to a logfile applications write to a hzLogger instance. This usually is a file but it might be a logserver instance (socket program)

Constructors/Detructors

hzLogger*hzLogger(hzLogger& never)
hzLogger*hzLogger(void)
NULL-TYPEhzLogger(void)hzLogger constructor. Initialize logger, and set the logger for the thread to this logger.
void~hzLogger(void)
NULL-TYPE~hzLogger(void)hzLogger destructor. There is currently no de-registration facility.

Public Methods:

hzEcodeClose(void)Close a log channel and remove it from the thread-logger table. Arguments: None
boolIsOpen(void)
boolIsVerbose(void)
hzEcodeLog(hzChain& Z)Writes out the supplied chain to the logfile 'as is' with no time-stamp or other supporting information.
hzEcodeLog(const char* va_alist)Log a variable argument message to the log channel. Deprecated as the hzFuncname class is to be reviewed.
hzEcodeLogr(hzEcode rc)const char* va_alist, Log a variable argument message to the log channel. Deprecated as the hzFuncname class is to be reviewed.
hzEcodeOpenFile(const char* fpath)hzLogRotate eRotate, Purpose: Open a LogChannel to use a file regime
hzEcodeOpenPrivate(const char* fpath)hzLogRotate eRotate, uint32_t nPerms, Purpose: Open a LogChannel to use a private logserver file
hzEcodeOpenPublic(const char* fpath)hzLogRotate eRotate, Purpose: Open a LogChannel to use a public logfile
hzEcodeOut(hzChain& Z)Writes out the supplied chain to the logfile 'as is' with no time-stamp or other supporting information.
hzEcodeOut(const char* va_alist)Writes out the supplied character string with varags to the logfile 'as is' with no time-stamp or other supporting information.
voidSetIndent(uint16_t nIndent)
voidVerbose(bool bVerbose)
void_logrotate(void)Private method to change the hzLogger output file so as to seperate logfiles into approapriate time periods. Arguments: None Returns: None
hzEcode_write(uint32_t nBytes)Private support function to unify logfile writing to either a logfile or a virtual logfile managed by the logserver.

Overloaded operators:

hzLogger&operator<<(hzChain& Z)Stream operator so that an entire hzChain contents can be output to the logfile.
hzLogger&operator<<(hzString& S)Stream operator so that a hzString can be output to the logfile.
hzLogger&operator<<(const char* str)Stream operator so that a char string can be output to the logfile.
hzLogger&operator=(hzLogger& never)

Member Variables:

hzStringm_BaseBasename of logfile
hzStringm_FileFull name of logfile
hzLockSm_LockMutex (if required)
boolm_bVerboseSend log messages to stdin as well as file
char*m_cvDataBuffer for preparation of log message
hzXDatem_datCurrCurrent date & time
hzXDatem_datLastLast date & time rotation occured
hzLogRotatem_eRotateLog rotate edict
uint16_tm_nIndentNo of tabs to indent
uint16_tm_nSessIDSession ID
hzTcpClient*m_pConnectionConnection as client to logserver
unsigned char*m_pDataBuffer for preparation of log message
char*m_pDataPtrSet at m_cvData or an offset to allow packet hdr
FILE*m_pFileThe active logfile