CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | List of all members
CYB::API::Logger Class Referenceabstract

The interface for writing safe logs. More...

#include <Logger.hpp>

Inheritance diagram for CYB::API::Logger:
Inheritance graph
[legend]

Public Types

enum  Level : byte { Level::DEV, Level::INFO, Level::WARN, Level::ERR }
 The severity of the log. More...
 

Public Member Functions

virtual void Log (const String::CStyle &AMessage, const Level ALevel)=0
 Log a message. Will be written to a text file on the Path returned by CurrentLog. More...
 
virtual void Flush (void) const noexcept=0
 Delays execution until all pending logs from the current thread have been written to the output. More...
 
virtual const String::CStyleCurrentLog (void) const noexcept=0
 Retrieve the string representation of the Path of the File the Logger is currently writing to. More...
 
virtual void SetDebugLogging (const bool AEnable) noexcept=0
 Enable/Disable filtering of Level::DEV logs. More...
 

Detailed Description

The interface for writing safe logs.

Definition at line 7 of file Logger.hpp.

Member Enumeration Documentation

The severity of the log.

Enumerator
DEV 

Debug messages, enabled/disabled by default in engine debug/release builds respectively.

INFO 

Generic information.

WARN 

Recoverable warnings.

ERR 

Hard errors.

Definition at line 10 of file Logger.hpp.

10  : byte {
11  DEV,
12  INFO,
13  WARN,
14  ERR,
15  };
unsigned char byte
It's a byte, 8 bits, etc...
Definition: Types.hpp:4

Member Function Documentation

virtual const String::CStyle& CYB::API::Logger::CurrentLog ( void  ) const
pure virtualnoexcept

Retrieve the string representation of the Path of the File the Logger is currently writing to.

Returns
The string representation of the Path of the File the Logger is currently writing to
Thread Safety
This function requires no thread safety

Implemented in CYB::Engine::Logger, and CYB::Platform::System::Console.

virtual void CYB::API::Logger::Flush ( void  ) const
pure virtualnoexcept

Delays execution until all pending logs from the current thread have been written to the output.

Thread Safety
This function requires no thread safety

Implemented in CYB::Engine::Logger, and CYB::Platform::System::Console.

virtual void CYB::API::Logger::Log ( const String::CStyle AMessage,
const Level  ALevel 
)
pure virtual

Log a message. Will be written to a text file on the Path returned by CurrentLog.

Parameters
AMessageThe message to log
ALevelThe Level of the message
Thread Safety
This function requires no thread safety
Exceptions
CYB::Exception::ViolationError code: CYB::Exception::Violation::INVALID_ENUM. Thrown if the ALevel is invalid In the near impossible case that the isolated Heap the Logger uses runs out of memory, this function will block and flush the write queue to free space This function may silently fail in the case that the log cannot be written to

Implemented in CYB::Engine::Logger, and CYB::Platform::System::Console.

Here is the caller graph for this function:

virtual void CYB::API::Logger::SetDebugLogging ( const bool  AEnable)
pure virtualnoexcept

Enable/Disable filtering of Level::DEV logs.

Parameters
AEnableEnables DEV logs if true, disables them otherwise
Thread Safety
This function requires no thread safety

Implemented in CYB::Engine::Logger, and CYB::Platform::System::Console.


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