SyTen
syten::Log Namespace Reference

Global variables for the logging subsystem. More...

Typedefs

using PrintPrefix = YesNo< struct _print_prefix >
 Used to indicate that the prefix should be printed. More...
 
using StreamIsTTY = YesNo< struct _stream_is_tty >
 Used to indicate that the supplied stream is a TTY. More...
 

Functions

template<typename... Args>
std::string format_args (Args &&... data)
 Constructs a text representation of a series of objects by shifting them into a std::stringstream. More...
 
std::string format_args (char const *c)
 Overload for format_args() taking a single C character array. More...
 
template<typename... Args>
std::string format_args (Fmt fmt, Args &&... data)
 Constructs a text representation of a series of objects by calling fmt::format() using the format string stored in the first one as the format specifier. More...
 
template<typename... Args>
std::string format_args (FmtNN fmt, Args &&... data)
 Constructs a text representation of a series of objects by calling fmt::format() using the format string stored in the first one as the format specifier. More...
 
std::string format_args (std::string const &s)
 Overload for format_args() taking a single string. More...
 
void initLogsP1 ()
 Sets stdcerr_is_tty. More...
 
void initLogsP2 ()
 Initialises the file streams if timing_log_name and/or generic_log_name are set and the log levels are greater than none. More...
 
template<typename... Args>
void log_impl (PrintPrefix pp, int level, std::ofstream &filestream, std::ostream &ttystream, Args &&... data)
 Implementation helper to decide if we need to generate logging output and where to put it. More...
 
void log_output (PrintPrefix pp, StreamIsTTY tty, int level, std::ostream &output_stream, std::string const &str)
 Outputs the supplied string to the supplied file stream. More...
 

Variables

std::ofstream generic_log
 file stream for generic data, if enabled More...
 
std::string generic_log_name
 file name for generic data, if enabled More...
 
bool stdcerr_is_tty
 true if std::cerr is a tty so that we can print colour codes More...
 
std::ofstream timing_log
 file stream for timing data, if enabled More...
 
std::string timing_log_name
 file name for timing data, if enabled More...
 
std::mutex warning_cerr_mtx
 mutex protecting std::cerr when printing to it More...
 

Detailed Description

Global variables for the logging subsystem.