CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBConsole.hpp
Go to the documentation of this file.
1 namespace CYB {
3  namespace Platform {
4  namespace System {
6  class Console : public API::Logger {
7  private:
10  std::atomic_bool FDevLog;
11  private:
19  static void WriteOut(const API::String::CStyle& AMessage, const bool AError) noexcept;
20  public:
29  Console();
30 
36  void Show(void) noexcept;
37 
42  void Log(const API::String::CStyle& AMessage, const Level ALevel) final override;
43 
48  void Flush(void) const noexcept final override;
49 
56  const API::String::CStyle& CurrentLog(void) const noexcept final override;
57 
59  void SetDebugLogging(const bool AEnable) noexcept final override;
60  };
61  };
62  };
63 };
const API::String::CStyle & CurrentLog(void) const noexceptfinaloverride
Returns the console path.
Definition: CYBConsole.cpp:55
void SetDebugLogging(const bool AEnable) noexceptfinaloverride
Enable/Disable filtering of Level::DEV logs.
Definition: CYBConsole.cpp:59
const API::String::Static FConsolePath
The 'path' of the console.
Definition: CYBConsole.hpp:9
void Show(void) noexcept
Show a window with console output. Will automatically be called if an error is logged.
Mutex FLock
To prevent simultaneous writes.
Definition: CYBConsole.hpp:8
A string pointing to unchanging data in the stack above it or the data segment. Must have UTF-8 encod...
Definition: StaticString.hpp:7
Console()
Contructs a console interface and sets up the fake Path and Logger.
Definition: CYBConsole.cpp:7
static void WriteOut(const API::String::CStyle &AMessage, const bool AError) noexcept
Write to either stdout or stderr depending on AError.
A basic char contained string.
Definition: CStyleString.hpp:7
Level
The severity of the log.
Definition: Logger.hpp:10
A fast locking, no order guaranteed, mutex.
Definition: CYBMutex.hpp:7
Contains the basic File interface. Does not perform locking of any kind, be aware of possible race co...
Definition: CYBConsole.hpp:6
void Flush(void) const noexceptfinaloverride
Delays execution until all pending logs from the current thread have been written to the output...
Definition: CYBConsole.cpp:53
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. ...
Definition: CYBConsole.cpp:12
The interface for writing safe logs.
Definition: Logger.hpp:7
std::atomic_bool FDevLog
Flag for enabling/disabling DEV logs.
Definition: CYBConsole.hpp:10