Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvLogger Class Reference

Used to log information or events in some logging category. More...

Public Member Functions

 PvLogger (const PvString &aCategory)
 Constructor. More...
 
virtual ~PvLogger ()
 Destructor.
 
void LogInfo (const char *aFile, int aLine, const char *aFunction, const char *aMessage)
 Add an info-level event to the log. More...
 
void LogError (const char *aFile, int aLine, const char *aFunction, const char *aMessage)
 Add an error-level event to the log. More...
 
void LogWarning (const char *aFile, int aLine, const char *aFunction, const char *aMessage)
 Add a warning-level event to the log. More...
 
void LogCritical (const char *aFile, int aLine, const char *aFunction, const char *aMessage)
 Add a critical-level event to the log. More...
 
void LogDebug (const char *aFile, int aLine, const char *aFunction, const char *aMessage)
 Add a debug-level event to the log. More...
 

Detailed Description

Used to log information or events in some logging category.

Constructor & Destructor Documentation

PvLogger::PvLogger ( const PvString aCategory)

Constructor.

Logging can be performed using the Log methods of this class but is usually performed using the PV_LOGINFO, PV_LOGERROR, PV_LOGWARNING, PV_LOGCRITICAL and PV_LOGDEBUG macros..

When using these macros, the first message parameter has to be a string. Other parameters are specific as a stream which can be strings, integers, floats and format objects of the PvFormat namespace.

PvLogger lLogger( "MyCategory" );
// Outputs "An error with result code 42 has occured"
PV_LOGINFO( lLogger, "An error with result code " << 42 << " has occured" );
// Outputs "123 test 10"
PV_LOGINFO( lLogger, "123 test " << std::hex << 16 );
// Outputs "123 test 20"
PV_LOGINFO( lLogger, "123 test " << std::oct << 16 );
// Outputs "123 test 16"
PV_LOGINFO( lLogger, "123 test " << std::dec << 16 );
// Outputs "123 test 3.142"
PV_LOGINFO( lLogger, "123 test " << std::cout.precision( 4 ) << 3.14159265 );
// Outputs "123 test **16"
PV_LOGINFO( lLogger, "123 test " << std::cout.width( 4 ) << std::cout.width( '*' ) << 16 );
Parameters
[in]aCategoryThe logging category.

Member Function Documentation

void PvLogger::LogCritical ( const char *  aFile,
int  aLine,
const char *  aFunction,
const char *  aMessage 
)

Add a critical-level event to the log.

Parameters
[in]aFileFile from which logging occured (usually FILE)
[in]aLineLine from which logging occured (usually LINE)
[in]aFunctionFunction from which logging occured (usually FUNCTION)
[in]aMessageLog message
void PvLogger::LogDebug ( const char *  aFile,
int  aLine,
const char *  aFunction,
const char *  aMessage 
)

Add a debug-level event to the log.

Parameters
[in]aFileFile from which logging occured (usually FILE)
[in]aLineLine from which logging occured (usually LINE)
[in]aFunctionFunction from which logging occured (usually FUNCTION)
[in]aMessageLog message
void PvLogger::LogError ( const char *  aFile,
int  aLine,
const char *  aFunction,
const char *  aMessage 
)

Add an error-level event to the log.

Parameters
[in]aFileFile from which logging occured (usually FILE)
[in]aLineLine from which logging occured (usually LINE)
[in]aFunctionFunction from which logging occured (usually FUNCTION)
[in]aMessageLog message
void PvLogger::LogInfo ( const char *  aFile,
int  aLine,
const char *  aFunction,
const char *  aMessage 
)

Add an info-level event to the log.

Parameters
[in]aFileFile from which logging occured (usually FILE)
[in]aLineLine from which logging occured (usually LINE)
[in]aFunctionFunction from which logging occured (usually FUNCTION)
[in]aMessageLog message
void PvLogger::LogWarning ( const char *  aFile,
int  aLine,
const char *  aFunction,
const char *  aMessage 
)

Add a warning-level event to the log.

Parameters
[in]aFileFile from which logging occured (usually FILE)
[in]aLineLine from which logging occured (usually LINE)
[in]aFunctionFunction from which logging occured (usually FUNCTION)
[in]aMessageLog message

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

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com