EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | Friends | List of all members
MsgLogger Class Reference

A trace or logging facility. More...

#include <MsgLogger.h>

Public Member Functions

 MsgLogger (const char *filename=0)
 Construct a new logger. More...
 
virtual ~MsgLogger ()
 Destructor. More...
 
void log (const char *format, va_list ap) __attribute__((format(printf
 Log some text. More...
 

Friends

void LOG_MSG (const char *format, va_list ap)
 Log message.
 

Detailed Description

A trace or logging facility.

The following printf and assert-like macros routines and macros will call TheMsgLogger->log:

* LOG_MSG("in init()\n");
* LOG_MSG("Value of i is %d\n", i);
* LOG_ASSERT(i > 2);
*

If no logger is created by the application, LOG_... will create a default logger for stderr.

Constructor & Destructor Documentation

MsgLogger::MsgLogger ( const char *  filename = 0)

Construct a new logger.

This logger replaces the existing logger, in case there is one. If no filename (null or empty string) is supplied, stderr is used. If a filename is provided, that file is opened or created for appending.

Parameters
filename,:file name
Exceptions
GenericExceptionif file fails to open.
virtual MsgLogger::~MsgLogger ( )
virtual

Destructor.

Will restore whatever previous logger was in place.

Member Function Documentation

void MsgLogger::log ( const char *  format,
va_list  ap 
)

Log some text.

Prepends info with time stamp, then invokes print.


The documentation for this class was generated from the following file: