Pleora Technologies Inc. eBUS SDK v7.0.1.7536 API



Loading...
Searching...
No Matches
PvLogger Class Reference

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

Public Member Functions

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

Detailed Description

Used to log information or events in some logging category.

Constructor & Destructor Documentation

◆ PvLogger()

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 );
Used to log information or events in some logging category.
Definition PvLogger.h:37
Parameters
[in]aCategoryThe logging category.

Member Function Documentation

◆ LogCritical()

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

◆ LogDebug()

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

◆ LogError()

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

◆ LogInfo()

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

◆ LogWarning()

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-2026 Pleora Technologies Inc.
www.pleora.com