23 std::size_t res = strftime(buffer,
sizeof(buffer),
"%H:%M:%S", r);
26 std::clog <<
"Could not write time to buffer" << std::endl;
33 const time_t timestamp,
34 const std::string& msg,
35 const bool print_time_information)
37 assert(
quiet != level);
39 const bool print_log_level= level >=
debug;
40 std::stringstream start_of_line;
41 if (print_time_information || print_log_level)
45 if (print_time_information)
49 if (print_time_information && print_log_level)
57 if (print_time_information || print_log_level)
59 start_of_line <<
"] ";
67 bool msg_ends_with_newline =
false;
70 msg_ends_with_newline = (msg[msg.size()-1] ==
'\n');
73 std::stringstream result;
77 bool overwrite =
false;
86 result <<
"\r" << start_of_line.str();
97 result <<
"\n" << start_of_line.str();
103 result << start_of_line.str();
108 for (std::string::const_iterator it = msg.begin(); it != msg.end(); )
117 if (++it != msg.end())
119 result <<
"\n" << start_of_line.str();
138 if(msg_ends_with_newline)
std::string log_level_to_string(const log_level_t level)
Convert log level to string This string is used to prefix messages in the logging output.
std::string format_time(const time_t *t)
log_level_t
Log levels that are supported.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...