API Documentation
Classes | Functions
nkLog Namespace Reference

Encompasses all API of component NilkinsLog. More...

Classes

class  ConsoleLogger
 A default implementation for a Logger that will log messages into the console. More...
 
class  FileLogger
 Default implementation of a logger outputing the logged information to a file. More...
 
class  Logger
 An interface to make all logging capabilities central. More...
 
class  String
 Allows to exchange strings with external code. More...
 
class  StringView
 Allows to exchange strings with external code. More...
 

Functions

nkLog::String operator+ (char c, const nkLog::String &str)
 
nkLog::String operator+ (const char *c, const nkLog::String &str)
 

Detailed Description

Encompasses all API of component NilkinsLog.

This component centralizes capabilities for logging information. It is used in all other components to log any information that needs to be inspected. Check how a nkLog::Logger has to be implemented. Implementing such a class means it can be plugged into all components of the engine, as such :

// Instantiate the logger, lifetime is managed by the client application
MyLogger logger ;

// Such a logger, if inheriting from the nkLog::Logger, can easily be injected
nkInputs::LogManager::getInstance()->setReceiver(&logger) ;
nkWinUi::LogManager::getInstance()->setReceiver(&logger) ;
nkGraphics::LogManager::getInstance()->setReceiver(&logger) ;
...
// Keep in mind, however, that the loggers need to outlive the log managers or be reset with nullptr before they get deleted

Function Documentation

◆ operator+() [1/2]

nkLog::String nkLog::operator+ ( char  c,
const nkLog::String str 
)
inline

Concatenation operator.

Parameters
cThe char to concatenate with.
strThe string to concatenate with.
Returns
A new string instance with the concatenated information, the char in front.

◆ operator+() [2/2]

nkLog::String nkLog::operator+ ( const char *  c,
const nkLog::String str 
)
inline

Concatenation operator.

Parameters
cThe string to concatenate with.
strThe string to concatenate with.
Returns
A new string instance with the concatenated information, the string pointer in front.