SA_Logger
Sapphire's Suite's C++ Logger.
Loading...
Searching...
No Matches
Namespaces | Macros | Functions | Variables
LogMacro.hpp File Reference

Log Helper Macros implementation. More...

#include <iostream>
#include <SA/Support/Debug.hpp>
#include <SA/Logger/Log/Log.hpp>
#include <SA/Logger/Misc/StringFormat.hpp>
#include <SA/Logger/Preprocessors/FileName.hpp>
#include <SA/Logger/Preprocessors/FunctionName.hpp>
#include <SA/Logger/Preprocessors/ChannelName.hpp>
#include <SA/Logger/Preprocessors/Unparenthese.hpp>

Go to the source code of this file.

Namespaces

namespace  SA::Debug
 Global Debug namespace.
 

Macros

#define SA_LOG_END_OF_FRAME()
 Sapphire Log end of frame macro.
 
#define SA_LOG((_str, _args)   , _lvl, _chan, _dets)
 Sapphire Log macro.
 
#define SA_WARN(_pred, _chan, _dets, _postCmd)
 
#define SA_ERROR(_pred, _chan, _dets, _postCmd)
 Sapphire Log "error if" macro.
 

Functions

void SA::Debug::InitDefaultLogger ()
 Initialize default logger for single-thread use. Console color and file output.
 
void SA::Debug::InitDefaultLoggerThread ()
 Initialize default logger for multi-thread use. Console color and file output.
 

Variables

LoggerBaseSA::Debug::logger
 Logger instance.
 
void(* SA::Debug::logCB )(SA::Log)
 Simple logger callback.
 

Detailed Description

Log Helper Macros implementation.

Macro Definition Documentation

◆ SA_ERROR

#define SA_ERROR ( _pred,
_chan,
_dets,
_postCmd )

Sapphire Log "error if" macro.

Helper macro to use conditionnal Debug::Log error.

Parameters
[in]_predpredicate of the Log. Output error on false.
[in]_chanChannel of the log (optional).
[in]_detsDetails string of the log (optional).
[in]_postCmdPost-log command on true predicate, usually for return value (optional).

◆ SA_LOG

#define SA_LOG ( )    , _lvl, _chan, _dets)

Sapphire Log macro.

Helper macro to use Debug::Log.

Parameters
[in]_strString message of the log. Parentheses are optionnal for single string or object.
[in]_argsArguments to insert in string using %<num>. Must add parentheses surrounding: (_str, _args).
[in]_lvlLevel of the log (optional).
[in]_chanChannel of the log (optional).
[in]_detsDetails string of the log (optional).

◆ SA_LOG_END_OF_FRAME

#define SA_LOG_END_OF_FRAME ( )

Sapphire Log end of frame macro.

Helper macro to track frame number used for logging.