KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::Log Class Reference

Karma's logging class with the logger like so. More...

#include <Log.h>

Static Public Member Functions

static void Init ()
 Initializes the logging class.
 
static std::shared_ptr< spdlog::logger > & GetCoreLogger ()
 Getter for the Core logger.
 
static std::shared_ptr< spdlog::logger > & GetClientLogger ()
 Getter for the Client logger.
 

Detailed Description

Karma's logging class with the logger like so.

Upon each log write the logger:

  1. Checks if its log level is enough to log the message and if yes:
  2. Call the underlying sinks to do the job.
  3. Each sink use its own private copy of a formatter to format the message and send to its destination.

The use of private formatter per sink provides the opportunity to cache some formatted data, and support for different format per sink.

Member Function Documentation

◆ GetClientLogger()

static std::shared_ptr< spdlog::logger > & Karma::Log::GetClientLogger ( )
inlinestatic

Getter for the Client logger.

Since
Karma 1.0.0

◆ GetCoreLogger()

static std::shared_ptr< spdlog::logger > & Karma::Log::GetCoreLogger ( )
inlinestatic

Getter for the Core logger.

Since
Karma 1.0.0

◆ Init()

void Karma::Log::Init ( )
static

Initializes the logging class.

The following steps are taken

  1. Couple of spdlog::logger instances are created with name "Karma" and "Application" for Engine and Game contexts.
  2. The logging patters is like so "%^[%T][%l] %n: %v%$" which has the example like so "[04:34:27][info] KARMA: Initialized Log"
Since
Karma 1.0.0

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