#include <string>
#include <iostream>
#include <chrono>
Go to the source code of this file.
|
void | ch::LogLine (std::ostream &stream, std::string const &func, std::string const &message) |
| Writes a logging message to a given ostream. More...
|
|
std::string | ch::FnError (std::string const &message, std::string const &file, unsigned line, std::string const &fn) |
| Generates an error message which includes the name of the calling function and the filename and line number where the error occured. More...
|
|
std::string | ch::GetQualififedName (std::string const &str) |
| Extracts the fully-qualified function name from a complete function signature. More...
|
|
◆ FNERROR
#define FNERROR |
( |
|
x | ) |
ch::FnError(x, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
◆ LOGLINE
#define LOGLINE |
( |
|
x, |
|
|
|
y |
|
) |
| LogLine(x, __func__, y) |
◆ FNLOG
#define FNLOG |
( |
|
x | ) |
x << "[" << __func__ << "] " |
◆ FNLOGC
#define FNLOGC |
( |
|
x, |
|
|
|
y |
|
) |
| if (y) x << "[" << __func__ << "] " |
◆ LAUNCH_FUNCTION_TIMER
#define LAUNCH_FUNCTION_TIMER |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
auto y = x.Inc();
std::string GetQualififedName(std::string const &str)
Extracts the fully-qualified function name from a complete function signature.
Conveniently initialise a ch::FnTimer instance.
This macro should be placed at the start of a function, e.g.:
void MyFunction() {
LAUNCH_FUNCTION_TIMER(__timer__, __token__)
}
The arguments are the names of two objects (a ch::FnTimer and a ch::FnTimer::Token) that will be created by this macro. Note that the ch::FnTimer will be assigned the current function name automatically.
Definition at line 67 of file Logging.h.