bes  Updated for version 3.20.6
BESDebug Class Reference
Collaboration diagram for BESDebug:
Collaboration graph

Public Types

typedef DebugMap::const_iterator debug_citer
 

Static Public Member Functions

static const DebugMap & debug_map ()
 
static std::string GetOptionsString ()
 
static std::string GetPidStr ()
 return the pid as a string More...
 
static std::ostream * GetStrm ()
 return the debug stream More...
 
static void Help (std::ostream &strm)
 Writes help information for so that developers know what can be set for debugging. More...
 
static bool IsContextName (const std::string &name)
 
static bool IsSet (const std::string &flagName)
 see if the debug context flagName is set to true More...
 
static void Register (const std::string &flagName)
 register the specified debug flag More...
 
static void Set (const std::string &flagName, bool value)
 set the debug context to the specified value More...
 
static void SetStrm (std::ostream *strm, bool created)
 set the debug output stream to the specified stream More...
 
static void SetUp (const std::string &values)
 Sets up debugging for the bes. More...
 

Detailed Description

Definition at line 88 of file BESDebug.h.

Member Function Documentation

◆ GetOptionsString()

string BESDebug::GetOptionsString ( )
static

This method looks at the current setting of the BESDebug object and builds a string that, when passed to a beslistener as the argument of the -d option, will mirror those settings. This is useful in code like the besdaemon, where debug contexts are set/cleared but that information has to be sent to the beslisteners to be used. The new option string will be built and the beslisteners restarted using it.

Definition at line 182 of file BESDebug.cc.

◆ GetPidStr()

string BESDebug::GetPidStr ( )
static

return the pid as a string

Returns
the pid as a string

Definition at line 124 of file BESDebug.cc.

◆ GetStrm()

static std::ostream* BESDebug::GetStrm ( )
inlinestatic

return the debug stream

Can be a file output stream or cerr

Returns
the current debug stream

Definition at line 176 of file BESDebug.h.

◆ Help()

void BESDebug::Help ( std::ostream &  strm)
static

Writes help information for so that developers know what can be set for debugging.

Displays information about possible debugging context, such as nc, hdf4, bes

Parameters
strmoutput stream to write the help information to

Definition at line 148 of file BESDebug.cc.

◆ IsSet()

static bool BESDebug::IsSet ( const std::string &  flagName)
inlinestatic

see if the debug context flagName is set to true

Parameters
flagNamedebug context to check if set
Returns
whether the specified flagName is set or not

Definition at line 157 of file BESDebug.h.

◆ Register()

static void BESDebug::Register ( const std::string &  flagName)
inlinestatic

register the specified debug flag

Allows developers to register a debug flag for when Help method is called. It's OK to register a context more than once (subsequent calls to Register() have no affect. If the pseudo-context 'all' has been registered, the context is set to true (messages will be printed), otherwise it is set to false.

Parameters
flagNamedebug context to register

Definition at line 138 of file BESDebug.h.

◆ Set()

static void BESDebug::Set ( const std::string &  flagName,
bool  value 
)
inlinestatic

set the debug context to the specified value

Static function that sets the specified debug context (flagName) to the specified debug value (true or false). If the context is found then the value is set. Else the context is created and the value set.

Parameters
flagNamedebug context flag to set to the given value
valueset the debug context to this value

Definition at line 116 of file BESDebug.h.

◆ SetStrm()

static void BESDebug::SetStrm ( std::ostream *  strm,
bool  created 
)
inlinestatic

set the debug output stream to the specified stream

Static method that sets the debug output stream to the specified std::ostream.

If the std::ostream was created (not set to cerr), then the created flag should be set to true.

If the current debug stream is set and the _debug_strm_created flag is set to true then delete the current debug stream.

set the static _debug_strm_created flag to the passed created flag

Parameters
strmset the current debug stream to strm
createdwhether the passed debug stream was created

Definition at line 198 of file BESDebug.h.

◆ SetUp()

void BESDebug::SetUp ( const std::string &  values)
static

Sets up debugging for the bes.

This static method sets up debugging for the bes given a set of values typically passed on the command line. Might look like the following:

-d "bes.debug,nc,hdf4,bes"

this method will break this down to set the output stream to an ofstream for the file bes.debug and turn on debugging for nc, hdf4, and bes.

Parameters
valuesto be parsed and set for debugging, bes.debug,nc,hdf4,bes

Definition at line 64 of file BESDebug.cc.


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