NAME

OTC_LogStream - Streams interface to the logger.

SYNOPSIS


#include <OTC/debug/logstrm.hh>

class OTC_LogStream : public ostream
{
  public:
    ~OTC_LogStream();
    OTC_LogStream(char* theBuffer=0, int theSize=0);
    inline OTC_LogLevel setLevel(OTC_LogLevel theLevel);
};

CLASS TYPE

Concrete

DESCRIPTION

The class OTC_LogStream is a streams interface to the message logging system implemented by the class OTC_Logger. Typically, you would not need to use the OTC_LogStream class directly. Instead, you should call the function OTCLIB_LOGGER() to get access to a central instance of the OTC_LogStream class. The maximum size message that can be accomodated by the stream returned by OTCLIB_LOGGER() is 2048 characters. If this is exceeded, the message will be split over multiple lines. The priority level at which you want messages to be logged, is defined by passing the level as an argument to the OTCLIB_LOGGER() function. Note that if your code needs to be thread safe, you should not use OTCLIB_LOGGER() but should create an instance of the OTC_LogStream class yourself.

EXAMPLE

An example of how you would use the OTCLIB_LOGGER() function is shown below. To ensure that messages are sent, the stream should be flushed explicitly. You can flush the stream by using the flush manipulator or by using endl. In either case, an end of line character will be output if necessary.

CONSTRUCTION

OTC_LogStream(char* theBuffer=0, int theSize=0);

LOG LEVEL

inline OTC_LogLevel setLevel(OTC_LogLevel theLevel);

SEE ALSO

OTC_LogBuf, OTC_Logger

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED