The Battle for Wesnoth  1.15.2+dev
Namespaces | Typedefs | Functions | Variables
log.cpp File Reference

Standard logging facilities (implementation). More...

#include "log.hpp"
#include <boost/date_time.hpp>
#include <map>
#include <sstream>
#include <ctime>
#include "global.hpp"
Include dependency graph for log.cpp:

Go to the source code of this file.

Namespaces

 lg
 

Typedefs

typedef std::map< std::string, int > lg::domain_map
 

Functions

static std::ostream null_ostream (new null_streambuf)
 
static boost::posix_time::time_facet facet ("%Y%m%d %H:%M:%S%F ")
 
static std::ostream & output ()
 
void lg::timestamps (bool t)
 
void lg::precise_timestamps (bool pt)
 
logger & lg::err ()
 
logger & lg::warn ()
 
logger & lg::info ()
 
logger & lg::debug ()
 
log_domain & lg::general ()
 
bool lg::set_log_domain_severity (const std::string &name, int severity)
 
bool lg::set_log_domain_severity (const std::string &name, const logger &lg)
 
bool lg::get_log_domain_severity (const std::string &name, int &severity)
 
std::string lg::list_logdomains (const std::string &filter)
 
void lg::set_strict_severity (int severity)
 
void lg::set_strict_severity (const logger &lg)
 
bool lg::broke_strict ()
 
std::string lg::get_timestamp (const std::time_t &t, const std::string &format)
 
std::string lg::get_timespan (const std::time_t &t)
 
static void lg::print_precise_timestamp (std::ostream &out) noexcept
 
std::stringstream & lg::wml_error ()
 Use this logger to send errors due to deprecated WML. More...
 

Variables

static int indent = 0
 
static bool timestamp = true
 
static bool precise_timestamp = false
 
static std::ostream * output_stream = nullptr
 
static domain_map * lg::domains
 
static int lg::strict_level_ = -1
 
static log_domain lg::dom ("general")
 
static bool lg::strict_threw_ = false
 

Detailed Description

Standard logging facilities (implementation).

See also the command line switches –logdomains and –log-<level>="domain".

Definition in file log.cpp.

Function Documentation

◆ facet()

static boost::posix_time::time_facet facet ( "%Y%m%d %H:%M:%S%F "  )
static

◆ null_ostream()

static std::ostream null_ostream ( new  null_streambuf)
static

Referenced by lg::logger::operator()().

◆ output()

static std::ostream& output ( )
static

Variable Documentation

◆ indent

int indent = 0
static

◆ output_stream

std::ostream* output_stream = nullptr
static

◆ precise_timestamp

bool precise_timestamp = false
static

Definition at line 46 of file log.cpp.

Referenced by lg::logger::operator()(), and lg::precise_timestamps().

◆ timestamp

bool timestamp = true
static