Classes | |
class | log_domain |
class | logger |
class | scope_logger |
class | tredirect_output_setter |
Helper class to redirect the output of the logger in a certain scope. More... | |
Typedefs | |
typedef std::map< std::string, int > | domain_map |
typedef std::pair< const std::string, int > | logd |
Variables | |
static domain_map * | domains |
static int | strict_level_ = -1 |
static bool | strict_threw_ = false |
typedef std::map<std::string, int> lg::domain_map |
typedef std::pair<const std::string, int> lg::logd |
bool lg::broke_strict | ( | ) |
Definition at line 170 of file log.cpp.
References strict_threw_.
Referenced by game_launcher::unit_test().
logger & lg::debug | ( | ) |
Definition at line 97 of file log.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), events::chat_handler::change_logging(), commandline_options::commandline_options(), lg::scope_logger::do_log_entry(), ai::ai_default_rca::get_villages_phase::get_villages(), game_events::t_event_handlers::log_handlers(), main(), game_events::t_pump::operator()(), commandline_options::parse_log_strictness(), game_events::t_pump::put_wml_message(), wb::move::remove_temp_modifier(), lg::scope_logger::scope_logger(), and gui2::tlogging::set_logger().
void lg::early_log_file_setup | ( | ) |
Sets up the initial temporary log file.
This has to be done on demand (preferably as early as possible) from a function rather than during static initialization, otherwise things go horribly wrong as soon as we try to use the logging facilities internally for debug messages.
Definition at line 455 of file log_windows.cpp.
Referenced by finish_log_file_setup(), and main().
void lg::enable_native_console_output | ( | ) |
Switches to using a native console instead of log file redirection.
In this mode, the log file is closed (if it was created in the first place) and output is sent directly to an attached or allocated console instead. This is used to implement the –wconsole command line option.
Using a native console instead of a file has the benefit of allowing to see output in real time or redirecting it to a user-specified file.
Definition at line 464 of file log_windows.cpp.
Referenced by main().
logger & lg::err | ( | ) |
Definition at line 79 of file log.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), events::chat_handler::change_logging(), mp::check_response(), commandline_options::commandline_options(), CreateTargetFromWindow(), preprocessor_data::get_chunk(), vconfig::get_parsed_config(), persist_file_context::load(), game_config_manager::load_addons_cfg(), cutter::load_config(), main(), os_tmpname(), commandline_options::parse_log_strictness(), twesnothd_connection::poll(), network_asio::connection::poll(), game_events::t_pump::put_wml_message(), savegame::read_save_file(), events::menu_handler::recall(), persist_file_context::save_context(), gui2::tlogging::set_logger(), gui2::show_error_message(), and gui2::show_transient_error_message().
void lg::finish_log_file_setup | ( | ) |
Relocates the stdout+stderr log file to the user data directory.
This function exits the process if something goes wrong (including calling it when the user data directory isn't known yet).
Definition at line 474 of file log_windows.cpp.
References early_log_file_setup(), ERR_LS, filesystem::file_exists(), filesystem::get_user_data_dir(), and filesystem::make_directory().
Referenced by filesystem::setup_user_data_dir().
log_domain & lg::general | ( | ) |
Definition at line 103 of file log.cpp.
Referenced by gui2::show_error_message(), and gui2::show_transient_error_message().
bool lg::get_log_domain_severity | ( | std::string const & | name, |
int & | severity | ||
) |
Definition at line 141 of file log.cpp.
Referenced by gui2::tlogging::pre_show().
std::string lg::get_timespan | ( | const time_t & | t | ) |
Definition at line 182 of file log.cpp.
Referenced by wesnothd::banned::get_human_time_span().
std::string lg::get_timestamp | ( | const time_t & | t, |
const std::string & | format | ||
) |
Definition at line 174 of file log.cpp.
References util::strftime().
Referenced by lg::scope_logger::do_log_exit(), preferences::get_chat_timestamp(), wesnothd::banned::get_human_end_time(), wesnothd::banned::get_human_start_time(), lg::logger::operator()(), and wesnothd::server::searchlog_handler().
logger & lg::info | ( | ) |
Definition at line 91 of file log.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), events::chat_handler::change_logging(), commandline_options::commandline_options(), network::disconnect(), events::console_handler::do_layers(), ai::default_recruitment::recruitment::execute(), help::generate_terrain_sections(), ai::default_recruitment::recruitment::get_cheapest_unit_cost_for_leader(), mp::options::manager::get_value_cfg(), wesnothd::server::handle_player_in_game(), game_lua_kernel::intf_get_terrain_info(), game_config_manager::load_addons_cfg(), main(), gui2::taddon_list::on_addon_select(), help::unit_topic_generator::operator()(), commandline_options::parse_log_strictness(), gui2::taddon_list::pre_show(), playmp_controller::process_oos(), events::pump(), game_events::t_pump::put_wml_message(), network::send_data(), network::send_file(), network::send_raw_data(), unit_type_data::set_config(), gui2::tlogging::set_logger(), sdl::twindow::twindow(), unit_moves(), and suh::user_info().
std::string lg::list_logdomains | ( | const std::string & | filter | ) |
Definition at line 150 of file log.cpp.
Referenced by process_command_args(), and gui2::tlogging::tlogging().
std::string lg::log_file_path | ( | ) |
Returns the path to the current log file.
An empty string is returned if the log file has not been set up yet or it was disabled (e.g. by –wconsole).
Definition at line 446 of file log_windows.cpp.
void lg::precise_timestamps | ( | bool | pt | ) |
Definition at line 77 of file log.cpp.
References precise_timestamp.
Referenced by process_command_args().
|
static |
bool lg::set_log_domain_severity | ( | std::string const & | name, |
int | severity | ||
) |
Definition at line 117 of file log.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), events::chat_handler::change_logging(), main(), process_command_args(), set_log_domain_severity(), and gui2::tlogging::set_logger().
bool lg::set_log_domain_severity | ( | std::string const & | name, |
const logger & | lg | ||
) |
Definition at line 137 of file log.cpp.
References lg::logger::get_severity(), and set_log_domain_severity().
Definition at line 160 of file log.cpp.
Referenced by commandline_options::parse_log_strictness(), and set_strict_severity().
void lg::set_strict_severity | ( | const logger & | lg | ) |
Definition at line 164 of file log.cpp.
References lg::logger::get_severity(), and set_strict_severity().
void lg::timestamps | ( | bool | t | ) |
Definition at line 76 of file log.cpp.
References timestamp.
Referenced by BOOST_AUTO_TEST_CASE(), and main().
logger & lg::warn | ( | ) |
Definition at line 85 of file log.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), events::chat_handler::change_logging(), commandline_options::commandline_options(), main(), commandline_options::parse_log_strictness(), game_events::t_pump::put_wml_message(), and gui2::tlogging::set_logger().
std::stringstream & lg::wml_error | ( | ) |
Use this logger to send errors due to deprecated WML.
The preferred format is: xxx is deprecated; support will be removed in version X. or xxx is deprecated; support has been removed in version X.
After every wml-event the errors are shown to the user, so they can inform the campaign maintainer.
Definition at line 262 of file log.cpp.
Referenced by unit::apply_modifications(), events::mouse_handler::attack_enemy(), context_free_grammar_generator::context_free_grammar_generator(), unit_abilities::effect::effect(), ai::default_recruitment::recruitment::execute(), ai::configuration::expand_simplified_aspects(), config::get_old_attribute(), get_renamed_config_attribute(), config::has_old_attribute(), basic_unit_filter_impl::internal_matches_filter(), intf_add_modification(), game_lua_kernel::intf_log(), luaW_pcall(), pathfind::manager::manager(), side_filter::match_internal(), terrain_filter::match_internal(), matches_simple_filter(), context_free_grammar_generator::print_nonterminal(), storyscreen::controller::resolve_wml(), storyscreen::part::resolve_wml(), game_events::t_pump::show_wml_errors(), unit_race::unit_race(), and game_events::WML_HANDLER_FUNCTION().
|
static |
Definition at line 74 of file log.cpp.
Referenced by commandline_options::parse_log_domains_().
|
static |
Definition at line 168 of file log.cpp.
Referenced by broke_strict().