 |
Belle II Software
release-05-02-19
|
13 #include <framework/logging/LogConfig.h>
14 #include <framework/logging/LogVariableStream.h>
46 std::string
function, std::string file,
unsigned int line,
int debugLevel = 0);
59 std::string
function, std::string file,
unsigned int line,
int debugLevel = 0);
122 std::ostream&
print(std::ostream& out)
const;
128 std::string
toJSON(
bool complete)
const;
142 return msg.m_logLevel ^ std::hash<std::string>()(msg.m_message.getMessage());
147 return (lhs.m_logLevel == rhs.m_logLevel) &&
148 (lhs.m_message.getMessage() == rhs.m_message.getMessage());
const std::string & getPackage() const
Returns the package where the message was sent from.
Specialized implementation of an ostream-like class where the << operator can be used to insert value...
int m_debugLevel
The debug level for messages with level=c_Debug.
LogVariableStream m_message
The message stream which should be sent.
bool operator==(const LogMessage &message) const
Compares two messages.
std::string m_package
The package name where the message was sent from.
std::string str(bool showVariables=true) const
Return the content of the stream as string.
const std::vector< LogVar > & getLogVariables() const
Return a reference to the log variables associated with this message.
ELogLevel
Definition of the supported log levels.
LogMessage(LogConfig::ELogLevel logLevel, const std::string &message, const char *package, std::string function, std::string file, unsigned int line, int debugLevel=0)
The LogMessage constructor.
bool operator!=(const LogMessage &message) const
Check for inequality.
LogMessage & operator=(const LogMessage &lvs)=default
Custom assignment-operator, thanks to stringsream's incompetence ...
Abstract base class for different kinds of events.
unsigned int m_logInfo
kind of information to show (ORed combination of LogConfig::ELogInfo flags).
std::string m_function
The function name where the message was sent from.
const std::vector< LogVar > & getVariables() const
Return the list of all defined variables.
LogConfig::ELogLevel m_logLevel
The log level of the message.
std::string m_module
The module name where the message was sent from.
std::ostream & operator<<(std::ostream &os, const BaseConstraint &bc)
Prints out a BaseConstraint, using its print method.
void setLogInfo(unsigned int logInfo)
Configure which information should be printed.
std::string toJSON(bool complete) const
Return a json string for the log message.
LogConfig::ELogLevel getLogLevel() const
Returns the log level of the message.
void setModule(const std::string &module)
Configure which information should be printed.
std::string m_file
The file name where the message was sent from.
std::size_t operator()(const LogMessage &msg) const
Return a hash for the given log message just based on the log level and the message.
const std::string getMessage() const
Returns the message text.
unsigned int m_line
The line number in the source code where the message was sent from.
std::ostream & print(std::ostream &out) const
Generate output stream.