NAME
OTC_LogBuf -
Streambuf class for use by OTC_LogStream.
SYNOPSIS
#include <OTC/debug/logbuf.hh>
class OTC_LogBuf : public streambuf
{
public:
~OTC_LogBuf();
OTC_LogBuf(char* theBuffer, int theSize);
inline OTC_LogLevel setLevel(OTC_LogLevel theLevel);
int sync();
protected:
streambuf* setbuf(char* theBuffer, int theSize);
int overflow(int c);
int underflow();
};
CLASS TYPE
Concrete
DESCRIPTION
OTC_LogBuf is used to used to manage the buffer used by
OTC_LogStream, to format messages which are to be sent to the
logger. Messages are automatically sent to the logger at the set
priority level, when the stream using this class is flushed,
or the buffer used in this class is filled.
INITIALISATION
OTC_LogBuf(char* theBuffer, int theSize);
Initialises the class to manage the buffer
being used to format messages by
OTC_LogStream. theBuffer should be the
buffer into which messages are going to be
formatted. theSize should be the size of
the buffer you have provided.
LOG LEVEL
inline OTC_LogLevel setLevel(OTC_LogLevel theLevel);
Sets the priority level for messages. When
a message is flushed or the buffer is
filled, the message will be sent to the
logger at priority level theLevel.
STREAM FLUSHING
int sync();
Writes out the message in the buffer
to the logger, using the current
message priority level.
SEE ALSO
OTC_Logger, OTC_LogStream
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED