Basic log functionalities.
More...
#include <MCLog.hpp>
|
static bool | GetDebugStatus (bool global=false) |
| Get debug status. More...
|
|
static void | SetDebugStatus (bool new_status, bool global=false) |
| Set debug status. More...
|
|
static std::string | GetDebugFilter () |
| Get debug filter. More...
|
|
static void | SetDebugFilter (const std::string &new_filter) |
| Set debug filter. More...
|
|
static std::string | GetDebugColorFilters () |
| Get debug color filter. More...
|
|
static void | SetDebugColorFilters (const std::string &new_color_filters) |
| Set debug color filters. More...
|
|
static void | SetCustomHandler (MCLogMessageHandler *handler, bool global=false) |
| Set custom message handler. More...
|
|
static void | LogMessage (const char *function, const char *format,...) |
| Print log message. More...
|
|
static void | ErrorMessage (const char *function, const char *format,...) CLANG_ANALYZER_NORETURN |
| Print error message with red color. More...
|
|
static void | WarningMessage (const char *function, const char *format,...) |
| Print warning message with yellow color. More...
|
|
static void | FormattedMessage (MCLog::ColorType color, bool bold, const char *format,...) |
| Print normal message. More...
|
|
static QString | ConvertFromAnsiToQtMarkup (const QString &orig_str) |
| Convert the ANSI codes to Qt markup format. More...
|
|
static QString | RemoveMarkup (const QString &orig_str) |
| Remove the markup. More...
|
|
|
static bool | IsAnyFilterMatched (const MC::StringList &filters, const std::string &function_name) |
| Check if any filter matches with the function name. More...
|
|
Basic log functionalities.
Definition at line 57 of file MCLog.hpp.
Types of message colors
Enumerator |
---|
MinColor |
Minimum value
|
Black |
Black color
|
Red |
Red color
|
Green |
Green color
|
Yellow |
Yellow color
|
Blue |
Blue color
|
Purple |
Purple color
|
Cyan |
Cyan color
|
White |
White color
|
NoColor |
No color
|
MaxColor |
Maximum value
|
Definition at line 61 of file MCLog.hpp.
Types of messages
Enumerator |
---|
Normal |
Normal message
|
Warning |
Warning message
|
Error |
Error message
|
Definition at line 77 of file MCLog.hpp.
QString MCLog::ConvertFromAnsiToQtMarkup |
( |
const QString & |
orig_str | ) |
|
|
static |
Convert the ANSI codes to Qt markup format.
- Parameters
-
- Returns
- Converted string.
Definition at line 374 of file MCLog.cpp.
void MCLog::ErrorMessage |
( |
const char * |
function, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
|
static |
Print error message with red color.
- Parameters
-
function | Function name |
format | Format string and its parameters of the error message |
Definition at line 229 of file MCLog.cpp.
void MCLog::FormattedMessage |
( |
MCLog::ColorType |
color, |
|
|
bool |
bold, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
|
static |
Print normal message.
- Parameters
-
color | Message color |
bold | Bold letters |
format | Format string and its parameters of the error message |
Definition at line 321 of file MCLog.cpp.
std::string MCLog::GetDebugColorFilters |
( |
| ) |
|
|
static |
Get debug color filter.
- Returns
- Debug color filter
Definition at line 105 of file MCLog.cpp.
std::string MCLog::GetDebugFilter |
( |
| ) |
|
|
static |
Get debug filter.
- Returns
- Debug filter
Definition at line 91 of file MCLog.cpp.
bool MCLog::GetDebugStatus |
( |
bool |
global = false | ) |
|
|
static |
Get debug status.
- Parameters
-
global | Whenever the global status is queried or only a thread local |
- Returns
- Boolean status of debug (true = enabled, false = disabled).
Definition at line 68 of file MCLog.cpp.
bool MCLog::IsAnyFilterMatched |
( |
const MC::StringList & |
filters, |
|
|
const std::string & |
function_name |
|
) |
| |
|
staticprotected |
Check if any filter matches with the function name.
- Parameters
-
filters | Filters |
function_name | Function name |
- Returns
- Boolean status of debug (true = enabled, false = disabled).
Definition at line 128 of file MCLog.cpp.
void MCLog::LogMessage |
( |
const char * |
function, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
|
static |
Print log message.
- Parameters
-
function | Function name |
format | Format string and its parameters of the debug message |
Definition at line 166 of file MCLog.cpp.
QString MCLog::RemoveMarkup |
( |
const QString & |
orig_str | ) |
|
|
static |
Remove the markup.
- Parameters
-
- Returns
- Plain string.
Definition at line 432 of file MCLog.cpp.
Set custom message handler.
- Parameters
-
handler | Custom message handler |
global | Whenever the global handler is set or only a thread local |
Note: The ownership of the handler class is taken, it is destroyed automatically.
Definition at line 119 of file MCLog.cpp.
void MCLog::SetDebugColorFilters |
( |
const std::string & |
new_color_filters | ) |
|
|
static |
Set debug color filters.
- Parameters
-
new_color_filters | New color filter of the global debug |
Definition at line 112 of file MCLog.cpp.
void MCLog::SetDebugFilter |
( |
const std::string & |
new_filter | ) |
|
|
static |
Set debug filter.
- Parameters
-
new_filter | New filter of the global debug |
Definition at line 98 of file MCLog.cpp.
void MCLog::SetDebugStatus |
( |
bool |
new_status, |
|
|
bool |
global = false |
|
) |
| |
|
static |
Set debug status.
- Parameters
-
global | Whenever the global status is set or only a thread local |
new_status | New status of global debug (true = enabled, false = disabled) |
Definition at line 79 of file MCLog.cpp.
void MCLog::WarningMessage |
( |
const char * |
function, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
|
static |
Print warning message with yellow color.
- Parameters
-
function | Function name |
format | Format string and its parameters of the error message |
Definition at line 279 of file MCLog.cpp.
The documentation for this class was generated from the following files:
- /home/kecsap/Downloads/00/aiboplus/aiboplus/mindcommon/src/MCLog.hpp
- /home/kecsap/Downloads/00/aiboplus/aiboplus/mindcommon/src/MCLog.cpp