OpenAssetIO
An abstract API for generalising interactions between a host application and an asset management system

A logger that sends messages to the console (stderr). More...

#include <ConsoleLogger.hpp>

Inheritance diagram for ConsoleLogger:

Public Types

using Ptr = ConsoleLoggerPtr
 
using ConstPtr = ConsoleLoggerConstPtr
 
- Public Types inherited from LoggerInterface
using Ptr = LoggerInterfacePtr
 
using ConstPtr = LoggerInterfaceConstPtr
 
enum  Severity {
  kDebugApi, kDebug, kInfo, kProgress,
  kWarning, kError, kCritical
}
 

Public Member Functions

void log (Severity severity, const Str &message) override
 Logs a message to the user. More...
 
- Public Member Functions inherited from LoggerInterface
virtual ~LoggerInterface ()
 Defaulted polymorphic destructor. More...
 
virtual bool isSeverityLogged (Severity severity) const
 Check if a given severity level should/will be filtered out. More...
 
void debugApi (const Str &message)
 
void debug (const Str &message)
 
void info (const Str &message)
 
void progress (const Str &message)
 
void warning (const Str &message)
 
void error (const Str &message)
 
void critical (const Str &message)
 

Static Public Member Functions

static ConsoleLoggerPtr make (bool shouldColorOutput=true)
 Creates a new instance of the ConsoleLogger. More...
 

Additional Inherited Members

- Static Public Attributes inherited from LoggerInterface
static constexpr std::array kSeverityNames
 

Detailed Description

A logger that sends messages to the console (stderr).

Member Typedef Documentation

Member Function Documentation

void log ( Severity  severity,
const Str message 
)
overridevirtual

Logs a message to the user.

This method must be implemented to present the supplied message to the user in an appropriate fashion.

Parameters
severityOne of the severity constants defined in Severity.
messageThe message string to be logged.

Implements LoggerInterface.

static ConsoleLoggerPtr make ( bool  shouldColorOutput = true)
static

Creates a new instance of the ConsoleLogger.

Parameters
shouldColorOutputWhen true, messages will be colored based on their severity.

The documentation for this class was generated from the following file:
  • /src/src/openassetio-core/include/openassetio/log/ConsoleLogger.hpp