Helper for logging classes. More...
#include <mfLoggingClass.h>
Public Member Functions | |
mfLoggingClass (std::string const &logCategory) | |
Constructor: initializes with the specified log category. More... | |
std::string | logCategory () const |
Returns the logging category string for this object. More... | |
mfLoggingClass const & | loggingClass () const |
Returns this object (as a logging class object). More... | |
Access to temporary loggers | |
These methods return a temporary logger for fast logging: mfLogError() << "That was not a smart thing to do!";
The returned log can also be made a bit less temporary if some more complex output is required: if (!reasons.empty()) {
auto log = mfLogError();
log << "That was not a smart thing to do, for "
<< size(reasons) << " reasons:";
log << "\n " << (iReason+1) << ": " << reason;
} // if
The mfLogError(__FILE__, __LINE__) << "That was not a smart thing to do!";
| |
mf::LogError | mfLogError (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogError() stream for logging. More... | |
mf::LogWarning | mfLogWarning (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogWarning() stream for logging. More... | |
mf::LogProblem | mfLogProblem (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogProblem() stream for logging. More... | |
mf::LogInfo | mfLogInfo (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogInfo() stream for logging. More... | |
mf::LogVerbatim | mfLogVerbatim (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogVerbatim() stream for logging. More... | |
mf::LogDebug | mfLogDebug (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogDebug() stream for logging. More... | |
mf::LogTrace | mfLogTrace (std::string const &file={}, int const lineNumber=0) const |
Returns a mf::LogTrace() stream for logging. More... | |
Private Attributes | |
std::string | fLogCategory |
Logging category string used for the messages. More... | |
Helper for logging classes.
A derived class can utilize the member functions of this class for easier tracking of the boilerplate category:
Definition at line 44 of file mfLoggingClass.h.
|
inline |
Constructor: initializes with the specified log category.
Definition at line 51 of file mfLoggingClass.h.
|
inline |
Returns the logging category string for this object.
Definition at line 54 of file mfLoggingClass.h.
|
inline |
Returns this object (as a logging class object).
Definition at line 57 of file mfLoggingClass.h.
|
inline |
Returns a mf::LogDebug() stream for logging.
Definition at line 119 of file mfLoggingClass.h.
|
inline |
Returns a mf::LogError() stream for logging.
Definition at line 94 of file mfLoggingClass.h.
|
inline |
Returns a mf::LogInfo() stream for logging.
Definition at line 109 of file mfLoggingClass.h.
|
inline |
Returns a mf::LogProblem() stream for logging.
Definition at line 104 of file mfLoggingClass.h.
|
inline |
Returns a mf::LogTrace() stream for logging.
Definition at line 124 of file mfLoggingClass.h.
|
inline |
Returns a mf::LogVerbatim() stream for logging.
Definition at line 114 of file mfLoggingClass.h.
|
inline |
Returns a mf::LogWarning() stream for logging.
Definition at line 99 of file mfLoggingClass.h.
|
private |
Logging category string used for the messages.
Definition at line 46 of file mfLoggingClass.h.