CAD Exchanger SDK
cadex::Base_Logger Class Reference

Provides a logger that accepts and dispatches logging messages. More...

Public Types

enum  Level {
  Trace, Debug, Info, Warning,
  Error, Fatal
}
 Defines a message severity level. More...
 

Public Member Functions

 ~Base_Logger ()
 Destructor.
 
void SetLevel (const Level theLevel)
 Sets message severity level.
 
Level GetLevel () const
 Returns a message severity level.
 
bool CanAccept (const Level theLevel) const
 Returns true if the logger accepts a message of the level theLevel.
 
void ForcedLog (const Level theLevel, const UTF8 *theMessage, const internal::Base_LoggerLocationInfo &theLocation)
 Logs a message with respective level and location information.
 
void ForcedLog (const Level theLevel, const UTF16 *theMessage, const internal::Base_LoggerLocationInfo &theLocation)
 Logs a message with respective level and location information.
 
void Register (Base_LoggerAppender &theAppender, const Level theMinLevel=Trace, const Level theMaxLevel=Fatal)
 Adds an appender to the logger.
 
void Unregister (const Base_LoggerAppender &theAppender)
 Removes an appender from the logger.
 

Static Public Member Functions

static Base_LoggerGlobalInstance ()
 Returns a global logger.
 

Protected Member Functions

 Base_Logger ()
 Constructor. More...
 

Detailed Description

Provides a logger that accepts and dispatches logging messages.

The logger is available via a singleton returned by GlobalInstance(). The message threshold level should be set with SetLevel(). Messages sent with lower level will be ignored.

Appenders must be registered/unregistered with Register()/Unregister(). The appenders process accepted messages in the order of their registration.

For details refer to Logging Support.

Examples:
misc/logging/main.cxx.

Member Enumeration Documentation

◆ Level

Defines a message severity level.

See also
Base_Logger::SetLevel().
Enumerator
Trace 

Reserved for internal use. Base_Logger::SetLevel() called with this level will set the Information level.

Debug 

Reserved for internal use. Base_Logger::SetLevel() called with this level will set the Information level.

Info 

Specifies some situation that can be useful for user's information. Examples may include specific configuration encountered in the environment.

Warning 

Specifies some non-critical violation of some requirement that can be gracefully handled. Examples may include missing (though expected) definition of a 3D curve which can be reconstructed from another available representation.

Error 

Specifies the error situation that can be handled by the application. Examples may include a failure to reconstruct some specific surface from the file being imported.

Fatal 

Specifies the fatal error situation that requires application termination. Currently no messages are sent with this level.

Constructor & Destructor Documentation

◆ Base_Logger()

cadex::Base_Logger::Base_Logger ( )
protected

Constructor.

Creates a logger with empty appenders list and the Fatal message level. Thus no messages will be accepted.