158 void Pause(
void) noexcept;
164 void Resume(
void) noexcept;
167 void Log(const API::String::CStyle& AMessage, const
Level ALevel) final override;
173 void Flush(
void) const noexcept final override;
176 const API::String::CStyle&
CurrentLog(
void) const noexcept final override;
void Flush(void) const noexceptfinaloverride
Delays execution until all pending logs from the current thread have been written to the output...
Template type for wrapping pointers and treating them as objects. Only works with CyberEngine interfa...
A memory pool manager and allocator.
void Pause(void) noexcept
Put the logging thread to sleep.
API::String::Dynamic FMessage
The pre-formatted text of the log.
static API::String::Dynamic FormatLogMessage(const API::String::CStyle &AMessage, const Level ALevel)
Prepend the level and time to a log message.
static API::String::Dynamic TimeString(const int AHour, const int AMinute, const int ASecond, const bool AColons)
Retrieve a string of the given time.
static Platform::System::File OpenFile(void)
Prepares the logging File for writing. May block for one second if the preferred filename is taken in...
void CancelThreadedOperation(void) override
Stops the writer thread. Does not guarantee an empty queue.
std::atomic_bool FCancelled
Cancel flag for FThread.
Platform::System::File FFile
The File being written to.
Used for string of allocated variable length.
const API::String::CStyle & CurrentLog(void) const noexceptfinaloverride
Retrieve the string representation of the Path of the File the Logger is currently writing to...
Context FContext
The Context to be used when calling the Logger.
Level FLevel
The Level of the message.
Platform::System::Mutex FFileLock
The lock used to acquire access to FFile.
Memory::Heap FHeap
The isolated Heap.
API::Interop::Object< Platform::System::Thread > FThread
The thread used for writing to the log file.
void BeginThreadedOperation(void) override
Writer thread. Runs in a loop until CancelThreadedOperation is called.
API::UniquePointer< LogEntry > FQueueHead
The message queue head.
void Resume(void) noexcept
Wake the logging thread.
A basic char contained string.
void Log(const API::String::CStyle &AMessage, const Level ALevel) finaloverride
Log a message. Will be written to a text file on the Path returned by CurrentLog. ...
The basic multithreading interface.
Log entries to be inserted into the queue.
static Platform::System::File OpenFileImpl(const Platform::System::Path &ABasePath)
Prepares the logging File for writing. May block for one second if the preferred filename is taken in...
API::UniquePointer< LogEntry > FNext
Next item in the linked list.
Implements the engine level functions for API::Interop::Contexts.
The threaded, queued engine logger.
Level
The severity of the log.
UniquePointer that uses our Allocator.
static void LogShutdownForEntry(API::UniquePointer< LogEntry > &&AEntry, API::Logger &AEmergency) noexcept
Takes a LogEntry Queue and logs it out to the current given emergency logger.
std::atomic_bool FDevLog
Flag for enabling/disabling DEV logs.
std::atomic_bool FPaused
Flag for sleeping the logging thread.
The interface for writing safe logs.
API::Threadable & SelfAsThreadable(void) noexcept
Returns the current object as a Threadable reference. Used to get around some weird VS construction i...
void EmptyQueue(void)
Empty FQueue and write it into FFile.
Platform::System::Mutex FQueueLock
The lock used to acquire access to FQueue.
void SetDebugLogging(const bool AEnable) noexceptfinaloverride
Enable/Disable filtering of Level::DEV logs.
LogEntry * FQueueTail
The message queue tail.