Tomographer  v1.0a
Tomographer C++ Framework Documentation
Tomographer::Logger::DefaultLoggerTraits Struct Reference

Default traits for Logger implementations. More...

#include <tomographer/tools/loggers.h>

+ Inheritance diagram for Tomographer::Logger::DefaultLoggerTraits:

Public Types

enum  
 

Detailed Description

Default traits for Logger implementations.

If you write your own logger class, you must also provide information about this class such as whether it is thread-safe by specializing the traits class, e.g.:

namespace Tomographer { namespace Logger {
template<>
struct LoggerTraits<MyCustomLogger> : public DefaultLoggerTraits
{
enum {
};
};
} } // namespaces

It's a good idea to inherit from DefaultLoggerTraits, so that if additional traits are added in the future, then your code will still compile.

Definition at line 286 of file loggers.h.

Member Enumeration Documentation

anonymous enum
Enumerator
IsThreadSafe 

Whether a same logger instance may be called from different threads simultaneously.

By default, loggers are not thread-safe.

StaticMinimumSeverityLevel 

A statically-determined minimum severity logging level.

The logger will automatically discard at compile-time any message with severity level strictly lesser than this level (regardless of the runtime level). Of course, the runtime level of the logger will be observed, but the runtime level cannot be set to a lower severity level than StaticMinimumSeverityLevel.

If set to LOWEST_SEVERITY_LEVEL, no messages are discarded at compile-time, and all messages are processed at runtime.

If set to -1, all messages are discarded (cf. VacuumLogger).

HasOwnGetLevel 

Whether the logger class can provide its own run-time level.

If set to 0 (the default), then the base logger stores the level given in the constructor and uses that as the logger's level. It also provides a level() method which returns the current level. Subclasses may set the level by calling the protected method LoggerBase::setLogLevel().

If set to 1, then any time the base logging engine needs to know the current logger's level, it will call the method level() on the derived logger object to obtain the current level.

HasFilterByOrigin 

Whether the logger has a filter based on the given 'origin'.

This flag may be set to either 0 (no filtering, the default) or 1 (filtering).

If filtering is activated, then before formatting and emitting messages the logging engine will test the logger object's filter_by_origin(int level, const char * origin). The message will only be emitted if this function returns true. Note that messages may have already been discarded if their severity was less important than the runtime level of the logger: those messages don't even reach this filtering function call.

Definition at line 288 of file loggers.h.


The documentation for this struct was generated from the following file: