fgms 0.11.8
The
FlightGear MultiPlayer Server
project
logstream Class Reference

Class to manage the debug logging stream. More...

#include <logstream.hxx>

Inheritance diagram for logstream:
logstream_base

Public Member Functions

 logstream (ostream &out)
 The default is to send messages to cerr. More...
 
string datestr (void)
 Return a date as a string, standard format. More...
 
void disable_log_class (sgDebugClass c)
 disable logging of a single class More...
 
void enable_log_class (sgDebugClass c)
 enable logging of a single class More...
 
void enable_with_date (bool enable)
 Enable output of date. More...
 
ostream & operator<< (const loglevel &l)
 Output operator to capture the debug level and priority of a message. More...
 
void set_output (ostream &out)
 Set the output stream. More...
 
void setLogLevels (sgDebugClass c, sgDebugPriority p)
 Set the global log class and priority level. More...
 
void setuserdatestr (DATEFUNC udsf)
 Set a user provided function, which returns a date as a string. More...
 

Public Attributes

bool with_date
 

Private Attributes

logbuf lbuf
 
DATEFUNC userdatestr
 

Related Functions

(Note that these are not member functions.)

logstreamsglog ()
 Return the one and only logstream instance. More...
 

Detailed Description

Class to manage the debug logging stream.

Definition at line 283 of file logstream.hxx.

Constructor & Destructor Documentation

logstream::logstream ( ostream &  out)
inline

The default is to send messages to cerr.

Parameters
outoutput stream

Definition at line 290 of file logstream.hxx.

Member Function Documentation

string logstream::datestr ( void  )

Return a date as a string, standard format.

Definition at line 129 of file logstream.cxx.

void logstream::disable_log_class ( sgDebugClass  c)

disable logging of a single class

Parameters
cthe class to be disabled

Definition at line 117 of file logstream.cxx.

void logstream::enable_log_class ( sgDebugClass  c)

enable logging of a single class

Parameters
cthe class to be enabled

Definition at line 111 of file logstream.cxx.

void logstream::enable_with_date ( bool  enable)
inline

Enable output of date.

Definition at line 348 of file logstream.hxx.

Referenced by FG_SERVER::Init(), and FG_SERVER::SetLogfile().

ostream & logstream::operator<< ( const loglevel l)
inline

Output operator to capture the debug level and priority of a message.

Parameters
llog level

Definition at line 358 of file logstream.hxx.

void logstream::set_output ( ostream &  out)
inline

Set the output stream.

Parameters
outoutput stream

Definition at line 302 of file logstream.hxx.

Referenced by FG_SERVER::Init(), and FG_SERVER::SetLogfile().

void logstream::setLogLevels ( sgDebugClass  c,
sgDebugPriority  p 
)

Set the global log class and priority level.

Parameters
cdebug class
ppriority

Definition at line 123 of file logstream.cxx.

Referenced by FG_SERVER::Init(), and FG_SERVER::SetLog().

void logstream::setuserdatestr ( DATEFUNC  udsf)
inline

Set a user provided function, which returns a date as a string.

Definition at line 335 of file logstream.hxx.

Friends And Related Function Documentation

logstream & sglog ( )
related

Return the one and only logstream instance.

We use a function instead of a global object so we are assured that cerr has been initialised.

Returns
current logstream

Definition at line 375 of file logstream.hxx.

Referenced by FG_SERVER::Init(), FG_SERVER::SetLog(), and FG_SERVER::SetLogfile().

Member Data Documentation

logbuf logstream_base::lbuf
inherited

Definition at line 276 of file logstream.hxx.

Referenced by logstream(), operator<<(), and set_output().

DATEFUNC logstream::userdatestr
private

Definition at line 354 of file logstream.hxx.

Referenced by datestr(), logstream(), and setuserdatestr().

bool logstream::with_date

Definition at line 351 of file logstream.hxx.

Referenced by datestr(), enable_with_date(), and logstream().


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