15#ifndef LOG_H_6014714286
16#define LOG_H_6014714286
53 const std::unique_ptr< Details > pimpl;
57 void pushTag(
const std::string& tag );
81 const std::string&
tag()
const;
122 static void*
operator new( std::size_t );
123 static void*
operator new[]( std::size_t );
267#define LIBCARNA_LOG_TAG_SCOPE( tag ) \
268 const ::LibCarna::base::Log::TagScope _tagScope##__COUNTER__( tag )
Contains forward-declarations.
Defines LibCarna::base::Singleton.
Represents an association.
Defines callback interface that is invoked when the Log system is about to shut down.
virtual ~OnShutdownListener()
Does nothing.
virtual void onLogShutdown()=0
Indicates that Log::instance is about to shut down.
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 writeLine(Severity severity, const std::string &formattedEntry) const =0
Logs formattedEntry with severity.
virtual void write(Severity, const std::string &) const override
Logs entry with severity.
virtual void write(Severity severity, const std::string &entry) const =0
Logs entry with severity.
virtual ~Writer()
Deletes.
Records log messages. The log writing is delegated to implementations of the Log::Writer interface....
void record(Severity severity, const std::string &entry) const
Instructs current writer to write entry with severity.
void addOnShutdownListener(OnShutdownListener &listener)
Makes listener be notified when the log system is about to shut down.
virtual ~Log()
Deletes. Notifies its shutdown listeners if they haven't been notified yet.
void setWriter(Writer *)
Sets object that log writing will be delegated to.
const std::string & tag() const
Tells current log tag.
Severity
Describes the severity of a log entry.
@ debug
Indicates messages that might be of interest when searching bugs.
@ error
Indicates errors like memory leaks.
@ fatal
Indicates errors that might lead to misbehaving program logic.
@ warning
Indicates warnings.
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...
Defines LibCarna::base::noncopyable and NON_COPYABLE.
#define NON_COPYABLE
Marks the class that it is placed in as non-copyable.