fgms 0.11.8
The
FlightGear MultiPlayer Server
project
logbuf Class Reference

logbuf is an output-only streambuf More...

#include <logstream.hxx>

Inheritance diagram for logbuf:

Public Types

typedef char_traits< char >::int_type int_type
 
typedef char_traits< char > traits_type
 

Public Member Functions

 logbuf ()
 Constructor. More...
 
 ~logbuf ()
 Destructor. More...
 
bool enabled ()
 Is logging enabled? More...
 
void set_log_state (sgDebugClass c, sgDebugPriority p)
 Set the logging level of subsequent messages. More...
 
void set_sb (streambuf *sb)
 Set the stream buffer. More...
 

Static Public Member Functions

static void disable_log_class (sgDebugClass c)
 disable logging of a single class More...
 
static void enable_log_class (sgDebugClass c)
 enable logging of a single class More...
 
static sgDebugClass get_log_classes ()
 Get the logging classes currently enabled. More...
 
static sgDebugPriority get_log_priority ()
 Get the current logging priority. More...
 
static void set_log_classes (sgDebugClass c)
 Set the allowed logging classes. More...
 
static void set_log_level (sgDebugClass c, sgDebugPriority p)
 Set the global logging level. More...
 
static void set_log_priority (sgDebugPriority p)
 Set the logging priority. More...
 

Protected Member Functions

int_type overflow (int ch)
 overflow More...
 
virtual int sync ()
 sync/flush More...
 

Private Member Functions

 logbuf (const logbuf &)
 
void operator= (const logbuf &)
 

Static Private Attributes

static bool console_enabled = false
 
static sgDebugClass logClass = SG_NONE
 
static bool logging_enabled = true
 
static sgDebugPriority logPriority = SG_INFO
 
static streambuf * sbuf = NULL
 The streambuf used for actual output. Defaults to cerr.rdbuf(). More...
 

Detailed Description

logbuf is an output-only streambuf

logbuf is an output-only streambuf with the ability to disable sets of messages at runtime. Only messages with priority >= logbuf::logPriority and debugClass == logbuf::logClass are output.

Definition at line 83 of file logstream.hxx.

Member Typedef Documentation

typedef char_traits<char>::int_type logbuf::int_type

Definition at line 90 of file logstream.hxx.

typedef char_traits<char> logbuf::traits_type

Definition at line 89 of file logstream.hxx.

Constructor & Destructor Documentation

logbuf::logbuf ( )

Constructor.

Definition at line 40 of file logstream.cxx.

logbuf::~logbuf ( )

Destructor.

Definition at line 44 of file logstream.cxx.

logbuf::logbuf ( const logbuf )
private

Member Function Documentation

void logbuf::disable_log_class ( sgDebugClass  c)
static

disable logging of a single class

Parameters
cthe class to be disabled

Definition at line 84 of file logstream.cxx.

Referenced by logstream::disable_log_class().

void logbuf::enable_log_class ( sgDebugClass  c)
static

enable logging of a single class

Parameters
cthe class to be enabled

Definition at line 76 of file logstream.cxx.

Referenced by logstream::enable_log_class().

bool logbuf::enabled ( )
inline

Is logging enabled?

Returns
true or false

Definition at line 101 of file logstream.hxx.

sgDebugClass logbuf::get_log_classes ( )
static

Get the logging classes currently enabled.

Returns
All enabled debug logging anded together.

Definition at line 92 of file logstream.cxx.

sgDebugPriority logbuf::get_log_priority ( )
static

Get the current logging priority.

Returns
The priority cutoff for logging messages.

Definition at line 104 of file logstream.cxx.

void logbuf::operator= ( const logbuf )
private
logbuf::int_type logbuf::overflow ( int  ch)
inlineprotected

overflow

Definition at line 222 of file logstream.hxx.

void logbuf::set_log_classes ( sgDebugClass  c)
static

Set the allowed logging classes.

Parameters
cAll enabled logging classes anded together.

Definition at line 70 of file logstream.cxx.

void logbuf::set_log_level ( sgDebugClass  c,
sgDebugPriority  p 
)
static

Set the global logging level.

Parameters
cdebug class
ppriority

Definition at line 63 of file logstream.cxx.

Referenced by logstream::setLogLevels().

void logbuf::set_log_priority ( sgDebugPriority  p)
static

Set the logging priority.

Parameters
pThe priority cutoff for logging messages.

Definition at line 98 of file logstream.cxx.

void logbuf::set_log_state ( sgDebugClass  c,
sgDebugPriority  p 
)
inline

Set the logging level of subsequent messages.

Parameters
cdebug class
ppriority

Definition at line 213 of file logstream.hxx.

Referenced by logstream::operator<<().

void logbuf::set_sb ( streambuf *  sb)

Set the stream buffer.

Parameters
sbstream buffer

Definition at line 53 of file logstream.cxx.

Referenced by logstream::logstream(), and logstream::set_output().

int logbuf::sync ( )
inlineprotectedvirtual

sync/flush

Definition at line 203 of file logstream.hxx.

Referenced by set_sb(), and ~logbuf().

Member Data Documentation

bool logbuf::console_enabled = false
staticprivate

Definition at line 188 of file logstream.hxx.

Referenced by overflow(), and set_log_state().

sgDebugClass logbuf::logClass = SG_NONE
staticprivate
bool logbuf::logging_enabled = true
staticprivate

Definition at line 187 of file logstream.hxx.

Referenced by enabled(), overflow(), and set_log_state().

sgDebugPriority logbuf::logPriority = SG_INFO
staticprivate

Definition at line 193 of file logstream.hxx.

Referenced by get_log_priority(), set_log_level(), set_log_priority(), and set_log_state().

streambuf * logbuf::sbuf = NULL
staticprivate

The streambuf used for actual output. Defaults to cerr.rdbuf().

Definition at line 185 of file logstream.hxx.

Referenced by overflow(), set_sb(), sync(), and ~logbuf().


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