49 #define __func__ __FUNCTION__ 94 typedef std::pair<const std::string, int>
logd;
122 bool timestamp_ =
false;
127 void set_indent(
int level);
128 void enable_timestamp();
129 void set_prefix(
const std::string& prefix);
136 logger(
char const *
name,
int severity): name_(name), severity_(severity) {}
138 bool show_names =
true,
bool do_indent =
false)
const;
142 return severity_ > domain.
domain_->second;
175 if (!
debug().dont_log(domain)) do_log_entry(str);
182 if (!
debug().dont_log(domain)) do_log_entry(str);
186 if (!str_.empty()) do_log_exit();
189 void do_log_entry(
const std::string& str) noexcept;
190 void do_log_exit() noexcept;
206 #define log_scope(description) lg::scope_logger scope_logging_object__(lg::general(), description); 207 #define log_scope2(domain,description) lg::scope_logger scope_logging_object__(domain, description); 209 #define LOG_STREAM(level, domain) if (lg::level().dont_log(domain)) ; else lg::level()(domain) | formatter() 212 #define LOG_STREAM_NAMELESS(level, domain) if (lg::level().dont_log(domain)) ; else lg::level()(domain, false) | formatter() 215 #define LOG_STREAM_INDENT(level,domain) if (lg::level().dont_log(domain)) ; else lg::level()(domain, true, true) | formatter() 219 #define FORCE_LOG_TO(logger, domain) logger(domain) | formatter() std::string get_timestamp(const std::time_t &t, const std::string &format)
std::string get_timespan(const std::time_t &t)
logger(char const *name, int severity)
redirect_output_setter(std::ostream &stream)
Constructor.
Helper class to redirect the output of the logger in a certain scope.
std::pair< const std::string, int > logd
scope_logger(const log_domain &domain, const char *str)
bool get_log_domain_severity(const std::string &name, int &severity)
bool dont_log(const log_domain &domain) const
~redirect_output_setter()
const log_domain & domain_
std::ostream * old_stream_
The previously set redirection.
std::stringstream & wml_error()
Use this logger to send errors due to deprecated WML.
void set_strict_severity(int severity)
terrain_code operator|(const terrain_code &a, const terrain_code &b)
std::string get_name() const
bool set_log_domain_severity(const std::string &name, int severity)
std::string list_logdomains(const std::string &filter)
scope_logger(const log_domain &domain, const std::string &str)
void precise_timestamps(bool pt)