btftoolchain
logging.h File Reference
#include <iostream>
#include <source_location>
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 helper
 
 helper::logging
 

Macros

#define FATAL_INTERNAL_ERROR_MSG(MSG)
 

Enumerations

enum class  helper::logging::LogLevel { helper::logging::none = 0 , helper::logging::error = 1 , helper::logging::warning = 2 , helper::logging::trace = 3 }
 Currently supported log levels for the logging feature. More...
 

Functions

void helper::logging::initLogging (LogLevel log_level, const std::string &log_file_path="")
 Initalizes the logging feature. More...
 
void helper::logging::flush ()
 Flushes the log. More...
 
std::ostream & helper::logging::printError (const source_location location=source_location::current())
 Writes an error message to the log. More...
 
std::ostream & helper::logging::printWarning (const source_location location=source_location::current())
 Writes a warning message to the log. More...
 
std::ostream & helper::logging::printTrace (const source_location location=source_location::current())
 Writes a trace message to the log. More...
 
std::ostream & helper::logging::printLog (LogLevel log_level, const source_location location)
 Prints a log message to the log. More...
 
std::string helper::logging::logLevelToString (LogLevel log_level)
 Converts the enum LogLevel into string. More...
 
std::string helper::logging::stripSourceFileName (const std::string &file_name)
 Gets the source file name out of the path. More...
 

Macro Definition Documentation

◆ FATAL_INTERNAL_ERROR_MSG

#define FATAL_INTERNAL_ERROR_MSG (   MSG)
Value:
{ \
const source_location location = source_location::current(); \
std::cout << "FATAL INTERNAL ERROR in <" << location.function_name() << "> at <" << location.line() << ">\n"; \
std::cout << MSG; \
std::terminate(); \
}