14#ifndef OPENMP_TOOLS_OMPTEST_INCLUDE_LOGGING_H
15#define OPENMP_TOOLS_OMPTEST_INCLUDE_LOGGING_H
107std::string
format(
const std::string &Message, std::set<FormatOption> Options);
112 bool FormatOutput =
true);
116 void log(
const std::string &Message,
Level LogLevel)
const;
143 std::ostream &OutStream;
149 mutable std::mutex LogMutex;
Contains assertion event constructors, for generally all observable events.
void log(const std::string &Message, Level LogLevel) const
Log the given message to the output.
Logger(Level LogLevel=Level::Warning, std::ostream &OutStream=std::cerr, bool FormatOutput=true)
void setFormatOutput(bool Enabled)
Set if output is being formatted (e.g. colored).
Level getLoggingLevel() const
Return the current (minimum) Logging Level.
void logEventMismatch(const std::string &Message, const omptest::OmptAssertEvent &OffendingEvent, Level LogLevel=Level::Error) const
Log a single event mismatch.
void setLoggingLevel(Level LogLevel)
Set the (minimum) Logging Level.
std::string getFormatSequence(Level LogLevel=Level::Default)
Returns the format options as escaped sequence, for the given logging level.
@ ColorBackgroundLightGray
@ ColorBackgroundLightBlue
@ ColorBackgroundDarkGray
@ ColorBackgroundLightRed
@ ColorBackgroundLightCyan
@ ColorBackgroundLightGreen
@ ColorBackgroundLightMagenta
@ ColorBackgroundLightYellow
const char * to_string(Level LogLevel)
Returns a string representation of the given logging level.
std::string format(const std::string &Message, FormatOption Option)
Format the given message with the provided option(s) and return it.
Assertion event struct, provides statically callable CTORs.