Photon C++ Client API: Logger Class Reference

Photon C++ Client API

Photon C++ Client API  4.1.12.2
Logger Class Reference
Inheritance diagram for Logger:
Collaboration diagram for Logger:

Public Member Functions

 Logger (int debugLevel=DebugLevel::WARNINGS)
 
void log (int debugLevel, const EG_CHAR *file, const EG_CHAR *function, bool printBrackets, unsigned int line, const EG_CHAR *dbgMsg,...) const
 
void vlog (int debugLevel, const EG_CHAR *file, const EG_CHAR *function, bool printBrackets, unsigned int line, const EG_CHAR *dbgMsg, va_list args) const
 
int getDebugOutputLevel (void) const
 
bool setDebugOutputLevel (int debugLevel)
 
void setListener (const BaseListener &listener)
 
const LogFormatOptionsgetFormatOptions (void) const
 
void setFormatOptions (const LogFormatOptions &formatOptions)
 
virtual Common::JStringtoString (Common::JString &retStr, bool withTypes=false) const
 
- Public Member Functions inherited from ToString
virtual ~ToString (void)
 
virtual JString typeToString (void) const
 
JString toString (bool withTypes=false) const
 

Detailed Description

A Logger instance works as debugging API to send formatted strings to its current listener instance via the EGLOG()-macro.

Constructor & Destructor Documentation

§ Logger()

Logger ( int  debugLevel = DebugLevel::WARNINGS)

Constructor: Creates a new Logger instance and sets the initial debug level.

Parameters
debugLevelthe minimum debug level that a message must have to actually get logged by this Logger instance (the default is DebugLevel::WARNINGS)

Member Function Documentation

§ log()

void log ( int  debugLevel,
const EG_CHAR *  file,
const EG_CHAR *  function,
bool  printBrackets,
unsigned int  line,
const EG_CHAR *  dbgMsg,
  ... 
) const

Not intended for direct use - you should use the EGLOG() macro instead!

§ vlog()

void vlog ( int  debugLevel,
const EG_CHAR *  file,
const EG_CHAR *  function,
bool  printBrackets,
unsigned int  line,
const EG_CHAR *  dbgMsg,
va_list  args 
) const

Not intended for direct use - you should use the EGLOG() macro instead!

§ getDebugOutputLevel()

int getDebugOutputLevel ( void  ) const

Returns the current level of debug information that's passed on to BaseListener::debugReturn().

Returns
one of the values in DebugLevel
See also
setDebugOutputLevel()

§ setDebugOutputLevel()

bool setDebugOutputLevel ( int  debugLevel)

Sets the current level of debug information that's passed on to BaseListener::debugReturn().

Parameters
debugLevelone of the values in DebugLevel
Returns
true if the new debug level has been set correctly, false otherwise.
See also
getDebugOutputLevel()

§ setListener()

void setListener ( const BaseListener listener)

Sets parameter "listener" as receiver for all debug output information, which gets logged by the Logger instance, on which this function has been called.

Parameters
listenera reference to an instance of a subclass of BaseListener
Returns
true if the new debug level has been set correctly, false otherwise.
See also
getDebugOutputLevel()

§ getFormatOptions()

const LogFormatOptions & getFormatOptions ( void  ) const
Returns
the LogFormatOptions that are used by this instance.
See also
setFormatOptions()

§ setFormatOptions()

void setFormatOptions ( const LogFormatOptions formatOptions)

Sets the log format options to the supplied value.

Parameters
formatOptionsthe new value to which the log format options will be set
See also
getFormatOptions()

§ toString()

JString & toString ( Common::JString retStr,
bool  withTypes = false 
) const
virtual
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

Implements ToString.