LLVM OpenMP 22.0.0git
omptest::logging Namespace Reference

Classes

class  Logger

Enumerations

enum class  Level : uint32_t {
  Diagnostic = 10 , Info = 20 , Warning = 30 , Error = 40 ,
  Critical = 50 , Default , ExpectedEvent , ObservedEvent ,
  OffendingEvent , Silent = 0xFFFFFFFF
}
enum class  FormatOption : uint32_t {
  None = 0 , Bold = 1 , Dim = 2 , Underlined = 4 ,
  Blink = 5 , Inverted = 7 , Hidden = 8 , ColorDefault = 39 ,
  ColorBlack = 30 , ColorRed = 31 , ColorGreen = 32 , ColorYellow = 33 ,
  ColorBlue = 34 , ColorMagenta = 35 , ColorCyan = 36 , ColorLightGray = 37 ,
  ColorDarkGray = 90 , ColorLightRed = 91 , ColorLightGreen = 92 , ColorLightYellow = 93 ,
  ColorLightBlue = 94 , ColorLightMagenta = 95 , ColorLightCyan = 96 , ColorWhite = 97 ,
  ColorBackgroundDefault = 49 , ColorBackgroundBlack = 40 , ColorBackgroundRed = 41 , ColorBackgroundGreen = 42 ,
  ColorBackgroundYellow = 43 , ColorBackgroundBlue = 44 , ColorBackgroundMagenta = 45 , ColorBackgroundCyan = 46 ,
  ColorBackgroundLightGray = 47 , ColorBackgroundDarkGray = 100 , ColorBackgroundLightRed = 101 , ColorBackgroundLightGreen = 102 ,
  ColorBackgroundLightYellow = 103 , ColorBackgroundLightBlue = 104 , ColorBackgroundLightMagenta = 105 , ColorBackgroundLightCyan = 106 ,
  ColorBackgroundWhite = 107
}

Functions

const charto_string (Level LogLevel)
 Returns a string representation of the given logging level.
std::string getFormatSequence (Level LogLevel=Level::Default)
 Returns the format options as escaped sequence, for 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.
std::string format (const std::string &Message, std::set< FormatOption > Options)

Enumeration Type Documentation

◆ FormatOption

enum class omptest::logging::FormatOption : uint32_t
strong
Enumerator
None 
Bold 
Dim 
Underlined 
Blink 
Inverted 
Hidden 
ColorDefault 
ColorBlack 
ColorRed 
ColorGreen 
ColorYellow 
ColorBlue 
ColorMagenta 
ColorCyan 
ColorLightGray 
ColorDarkGray 
ColorLightRed 
ColorLightGreen 
ColorLightYellow 
ColorLightBlue 
ColorLightMagenta 
ColorLightCyan 
ColorWhite 
ColorBackgroundDefault 
ColorBackgroundBlack 
ColorBackgroundRed 
ColorBackgroundGreen 
ColorBackgroundYellow 
ColorBackgroundBlue 
ColorBackgroundMagenta 
ColorBackgroundCyan 
ColorBackgroundLightGray 
ColorBackgroundDarkGray 
ColorBackgroundLightRed 
ColorBackgroundLightGreen 
ColorBackgroundLightYellow 
ColorBackgroundLightBlue 
ColorBackgroundLightMagenta 
ColorBackgroundLightCyan 
ColorBackgroundWhite 

Definition at line 47 of file Logging.h.

◆ Level

enum class omptest::logging::Level : uint32_t
strong
Enumerator
Diagnostic 
Info 
Warning 
Error 
Critical 
Default 
ExpectedEvent 
ObservedEvent 
OffendingEvent 
Silent 

Definition at line 29 of file Logging.h.

Function Documentation

◆ format() [1/2]

std::string omptest::logging::format ( const std::string & Message,
FormatOption Option )

Format the given message with the provided option(s) and return it.

Here formatting is only concerning control sequences using <Esc> character which can be obtained using '' (on console), '\033' or '\x1B'.

Definition at line 77 of file Logging.cpp.

References int.

Referenced by omptest::logging::Logger::logEventMismatch(), and omptest::logging::Logger::logEventMismatch().

◆ format() [2/2]

std::string omptest::logging::format ( const std::string & Message,
std::set< FormatOption > Options )

Definition at line 84 of file Logging.cpp.

References int.

◆ getFormatSequence()

std::string omptest::logging::getFormatSequence ( Level LogLevel = Level::Default)

Returns the format options as escaped sequence, for the given logging level.

Definition at line 61 of file Logging.cpp.

References AggregatedFormatOptions, and int.

Referenced by omptest::logging::Logger::log(), omptest::logging::Logger::logEventMismatch(), and omptest::logging::Logger::logEventMismatch().

◆ to_string()

const char * omptest::logging::to_string ( Level LogLevel)

Returns a string representation of the given logging level.

Definition at line 41 of file Logging.cpp.

References Critical, Diagnostic, Error, Info, Silent, and Warning.

Referenced by omptest::logging::Logger::log(), omptest::logging::Logger::logEventMismatch(), and omptest::logging::Logger::logEventMismatch().