12#ifndef LOG_H_6014714286
13#define LOG_H_6014714286
15#include <Carna/Carna.h>
50 const std::unique_ptr< Details > pimpl;
54 void pushTag(
const std::string& tag );
78 const std::string&
tag()
const;
120 static void*
operator new( std::size_t );
121 static void*
operator new[]( std::size_t );
269#define CARNA_LOG_TAG_SCOPE( tag ) \
270 const ::Carna::base::Log::TagScope _tagScope##__COUNTER__( tag )
Defines Carna::base::Singleton.
Represents an association.
Defines callback interface that is invoked when the Log system is about to shut down.
virtual void onLogShutdown()=0
Indicates that Log::instance is about to shut down.
virtual ~OnShutdownListener()
Does nothing.
Writes fatal and error classified log messages to std::cerr and such classified as warning or debug t...
virtual void writeLine(Severity, const std::string &) const override
Logs formattedEntry with severity.
Abstract implementation of the Writer interface, that formats log messages along with their severity ...
virtual void write(Severity, const std::string &) const override
Logs entry with severity.
virtual void writeLine(Severity severity, const std::string &formattedEntry) const =0
Logs formattedEntry with severity.
virtual ~Writer()
Deletes.
virtual void write(Severity severity, const std::string &entry) const =0
Logs entry with severity.
Records log messages. The log writing is delegated to implementations of the Log::Writer interface....
void setWriter(Writer *)
Sets object that log writing will be delegated to.
const std::string & tag() const
Tells current log tag.
virtual ~Log()
Deletes. Notifies its shutdown listeners if they haven't been notified yet.
Severity
Describes the severity of a log entry.
@ fatal
Indicates errors that might lead to misbehaving program logic.
@ debug
Indicates messages that might be of interest when searching bugs.
@ error
Indicates errors like memory leaks.
@ warning
Indicates warnings.
void addOnShutdownListener(OnShutdownListener &listener)
Makes listener be notified when the log system is about to shut down.
void record(Severity severity, const std::string &entry) const
Instructs current writer to write entry with severity.
void removeOnShutdownListener(const OnShutdownListener &listener)
Makes listener no longer be notified when the log system is about to shut down.
void shutdown()
Notifies the shutdown listeners that the log system is about to shut down, if they haven't been notif...
#define NON_COPYABLE
Features class it is placed in as non-copyable.