![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
Module for parameTrized pretty-printing logs on the console, with colors, automatically prefixed by source path and such. More...
Classes | |
class | Color |
Define ANSI colors (including foreground, background, bold and underline) for global use in std C/elm strings/outstreams, using implicit type conversions. More... | |
class | Debug |
Provide necessary static methods to configure debugging for the use of the ELM_DBG* macros. More... | |
Macros | |
#define | ELM_DBG(str) { if(elm::log::Debug::getDebugFlag()) elm::cout << elm::log::Debug::debugPrefix(__FILE__, __LINE__) << str << elm::color::RCol(); } |
Format and output the string str on the log, depending on the global parameTers set in flags and srcpath_length. If ELM_NO_DBG is not defined, the alias DBG is available. More... | |
#define | ELM_DBGLN(str) { if(elm::log::Debug::getDebugFlag()) elm::cout << elm::log::Debug::debugPrefix(__FILE__, __LINE__) << str << elm::color::RCol() << elm::io::endl; } |
The same as ELM_DBG, except it adds a new line character at the end. If ELM_NO_DBG is not defined, the alias DBG is available. More... | |
#define | ELM_DBGV(level, str) { if(level & elm::log::Debug::getVerboseLevel()) ELM_DBG(str); } |
Will only output the string str if (level & verbose_level) is non-null, that is, if one of the bits in the bit mask level is set to 1 in the global variable verbose_level. More... | |
Functions | |
static void | setDebugFlag (bool set=true) |
Enable/Disable debugging messages. More... | |
static void | setSourceInfoFlag (bool set=true) |
Enable/Disable printing source info in the prefix of logs. More... | |
static void | setNumberingFlag (bool set=true) |
Enable/Disable numbering of the logs. More... | |
static void | setColorFlag (bool set=true) |
Enable/Disable the use of colors in logs. More... | |
static void | setVerboseLevel (int verbose_level) |
Set the verbose level to use. More... | |
static void | setSourcePathLength (int srcpath_length) |
Set a new source path length to use in the prefix of logs. More... | |
static void | setPrefixColor (const color::Color &prefix_color) |
Set a new color for the prefix of logs. More... | |
static elm::String | debugPrefixWrapped (const char *file, int line) |
Display prefix of log line, which may include the source path and line number of file, the line number of the log, both or neither. More... | |
Module for parameTrized pretty-printing logs on the console, with colors, automatically prefixed by source path and such.
#define ELM_DBG | ( | str | ) | { if(elm::log::Debug::getDebugFlag()) elm::cout << elm::log::Debug::debugPrefix(__FILE__, __LINE__) << str << elm::color::RCol(); } |
#include <include/elm/log/Log.h>
Format and output the string str on the log, depending on the global parameTers set in flags and srcpath_length.
If ELM_NO_DBG is not defined, the alias DBG is available.
Str | the string to print |
#define ELM_DBGLN | ( | str | ) | { if(elm::log::Debug::getDebugFlag()) elm::cout << elm::log::Debug::debugPrefix(__FILE__, __LINE__) << str << elm::color::RCol() << elm::io::endl; } |
#include <include/elm/log/Log.h>
The same as ELM_DBG, except it adds a new line character at the end.
If ELM_NO_DBG is not defined, the alias DBG is available.
Str | the string to print |
#define ELM_DBGV | ( | level, | |
str | |||
) | { if(level & elm::log::Debug::getVerboseLevel()) ELM_DBG(str); } |
#include <include/elm/log/Log.h>
Will only output the string str if (level & verbose_level) is non-null, that is, if one of the bits in the bit mask level is set to 1 in the global variable verbose_level.
Str | the string to print |
Level | bitmask to select the levels of verbose that should enable this debug. If level=0, it will never be printed. |
|
static |
#include <include/elm/log/Log.h>
Display prefix of log line, which may include the source path and line number of file, the line number of the log, both or neither.
References elm::_, elm::io::align(), Debug::getNumberingFlag(), Debug::getSourceInfoFlag(), Debug::getSourcePathLength(), String::length(), elm::color::RCol(), elm::io::RIGHT, String::substring(), and elm::io::width().
Referenced by Debug::debugPrefix().
#include <include/elm/log/Log.h>
Enable/Disable the use of colors in logs.
Boolean | to set the flag to |
#include <include/elm/log/Log.h>
Enable/Disable debugging messages.
Boolean | to set the flag to |
#include <include/elm/log/Log.h>
Enable/Disable numbering of the logs.
Boolean | to set the flag to |
|
static |
#include <include/elm/log/Log.h>
Set a new color for the prefix of logs.
The | new color to use for the prefix of logs |
#include <include/elm/log/Log.h>
Enable/Disable printing source info in the prefix of logs.
Boolean | to set the flag to |
|
inlinestatic |
#include <include/elm/log/Log.h>
Set a new source path length to use in the prefix of logs.
The | new source path length to use for the prefix |
|
inlinestatic |
#include <include/elm/log/Log.h>
Set the verbose level to use.
The | new verbose level to be set |