Crossfire Server, Branches 1.12  R18729
logger.c File Reference
#include <stdarg.h>
#include <global.h>
#include <sproto.h>
+ Include dependency graph for logger.c:

Go to the source code of this file.

Functions

void LOG (LogLevel logLevel, const char *format,...)
 

Variables

static const char *const loglevel_names []
 
int reopen_logfile = 0
 

Detailed Description

This handles logging, to file or strerr/stdout.

Definition in file logger.c.

Function Documentation

void LOG ( LogLevel  logLevel,
const char *  format,
  ... 
)

Logs a message to stderr, or to file. Or discards the message if it is of no importance, and none have asked to hear messages of that logLevel.

See include/logger.h for possible logLevels. Messages with llevInfo and llevError are always printed, regardless of debug mode.

Parameters
logLevellevel of the message
formatmessage to log. Works like printf() and such

Definition at line 63 of file logger.c.

References clean_tmp_files(), Settings::debug, emergency_save(), exiting, llevError, llevInfo, LOG(), Settings::log_timestamp, Settings::log_timestamp_format, logfile, Settings::logfilename, loglevel_names, MAX_ERRORS, nroferrors, reopen_logfile, settings, TRUE, trying_emergency_save, and vsnprintf.

Referenced by add_abilities(), add_book(), add_book_to_list(), add_button_link(), add_friendly_object(), add_god_to_list(), add_score(), add_to_buffer(), adj_attackroll(), alchemy_failure_effect(), allocate_map(), animate_object(), animate_weapon(), CREUtils::animationNode(), append_spell(), apply_builder_remove(), apply_cmd(), apply_container(), apply_map_builder(), apply_special(), arch_to_object(), arrow_type_process(), artifact_msg(), assign_region_parents(), attempt_do_alchemy(), attempt_recipe(), block_until_new_connection(), blocked_link(), calc_alch_danger(), calc_skill_exp(), can_detect_enemy(), can_pay(), cast_cone(), cast_consecrate(), cast_create_missile(), cast_create_town_portal(), cast_dust(), cast_light(), cast_spell(), cast_wonder(), cast_word_of_recall(), cfapi_log(), cfapi_object_delete(), cfapi_object_insert(), cfapi_object_remove(), change_attr_value(), change_book(), change_exp(), change_luck(), change_object(), check_altar_sacrifice(), check_faceset_fallback(), check_formulae(), check_login(), check_recipe(), check_special_prayers(), check_spells(), check_treasurelist(), check_trigger(), check_weapon_power(), checkbanned(), checkdm(), choose_cult_monster(), clean_friendly_list(), clean_tmp_files(), cleanup(), command_arrest(), command_banish(), command_create(), command_help(), command_loadplugin(), command_pickup(), command_reset(), command_unloadplugin(), command_use(), command_whereabouts(), common_ob_move_on(), common_pre_ob_move_on(), common_process_projectile(), communicate(), compile_info(), content_recipe_value(), convert_item(), copy_file(), create_one_treasure(), create_treasure(), dead_player(), deathstrike_living(), deep_swamp_type_process(), delete_map(), determine_holy_arch(), die_roll(), display_high_score(), display_who_entry(), do_forget_spell(), do_harvest(), do_learn_spell(), do_server(), do_skill(), do_skill_attack(), do_throw(), dragon_ability_gain(), drain_specific_stat(), draw_client_map(), draw_ext_info(), draw_magic_map(), dump_alchemy(), dump_alchemy_costs(), dump_all_archetypes(), dump_all_objects(), dump_friendly_objects(), dump_map(), emergency_save(), enter_exit(), enter_fixed_template_map(), enter_map(), enter_player_savebed(), enter_unique_map(), esrv_add_spells(), esrv_draw_look(), esrv_move_object(), esrv_remove_spell(), esrv_send_animation(), esrv_send_face(), esrv_update_item(), esrv_update_stats(), examine_cmd(), execute_event(), execute_newserver_command(), expand_lighted_sight(), explode_bullet(), find_animation(), find_archetype(), find_color(), find_doors_in_room_recursive(), find_mon_throw_ob(), find_nearest_living_creature(), find_recipe(), find_throw_ob(), find_title(), find_transmution_ob(), find_treasurelist(), fire_bow(), fire_misc_object(), fix_flesh_item(), fix_generated_item(), fix_multipart_object(), fix_object(), fix_weight(), flee_player(), flush_old_maps(), follow_owner(), follower_level_to_enchantments(), food_type_apply(), forbid_play(), free_all_archs(), free_all_god(), free_all_maps(), free_all_newserver(), free_all_object_data(), free_all_objects(), free_all_readable(), free_all_recipes(), free_map(), free_newsocket(), free_object2(), free_player(), free_races(), free_style_maps(), gate_type_process(), generate_artifact(), generate_monster_arch(), generate_monster_inv(), generate_treasure(), get_attack_mode(), get_face_fallback(), get_jail_exit(), get_name_of_region_for_map(), get_nearest_player(), get_object(), get_owner(), get_party_password(), get_player_archetype(), get_rand_god(), get_random_mon(), get_random_recipelist(), get_region_by_name(), get_region_longname(), get_region_msg(), get_split_ob(), get_titlelist(), get_typedata_by_name(), give_initial_items(), give_skill_by_name(), god_enchants_weapon(), god_info_msg(), god_intervention(), handle_client(), hit_map(), hit_player(), hit_with_one_attacktype(), i18n_init(), identify_altar_type_move_on(), improve_armour(), improve_weapon(), init_anim(), init_archetable(), init_artifacts(), init_attackmess(), init_book_archive(), init_clocks(), init_connection(), init_dynamic(), init_emergency_mappath(), init_experience(), init_formulae(), init_gods(), init_mon_info(), init_msgfile(), init_races(), init_readable(), init_regions(), init_server(), init_signals(), init_skills(), init_startup(), initPlugins(), inscribe_scroll_cmd(), insert_ob_in_map(), insert_ob_in_ob(), key_change_class(), key_roll_stat(), kill_object(), learn_skill(), leave(), legal_artifact_combination(), level_for_item(), link_player_skills(), load_archetypes(), load_map_header(), load_materials(), load_objects(), load_original_map(), load_overlay_map(), load_settings(), load_temporary_map(), load_treasure(), load_treasures(), load_unique_objects(), local_check_loaded_object(), lock_item_cmd(), LOG(), lookup_spell_by_name(), magic_from_difficulty(), magic_wall(), main(), make_formula_book(), make_item_from_recipe(), make_object_glow(), make_path_to_file(), make_throw_ob(), map2_add_ob(), mark_item_cmd(), merge_spell(), metaserver2_init(), metaserver2_writer(), metaserver_init(), metaserver_update(), mon_info_msg(), monster_cast_spell(), monster_check_apply(), monster_use_bow(), monster_use_range(), monster_use_skill(), move_cmd(), move_cone(), move_creator(), move_detector(), move_duplicator(), move_firewall(), move_golem(), move_monster(), move_ob(), move_player(), move_player_mover(), move_symptom(), move_teleporter(), msgfile_msg(), new_player_cmd(), numb_ob_inside(), open_and_uncompress_file(), operate_altar(), parse_dialog_information(), parse_regions(), parse_shop_string(), path_combine(), path_normalize(), pay_for_amount(), pay_for_item(), pay_from_container(), pet_move(), pick_up(), place_special_exit(), player_can_view(), player_changer_type_process(), plugins_init_plugin(), poison_living(), poison_type_apply(), poisoning_type_process(), polymorph_item(), potion_type_apply(), present(), present_arch(), process_events(), query_base_name(), query_cost(), query_money(), query_short_name(), random_roll(), random_roll64(), read_bmap_names(), read_client_images(), read_face_data(), read_map_log(), read_smooth(), ready_map_name(), rec_sigbus(), rec_sigint(), rec_sigpipe(), rec_sigquit(), rec_sigsegv(), rec_sigterm(), receive_player_password(), remove_all_pets(), remove_button_link(), remove_directory(), remove_friendly_object(), remove_ob(), remove_party(), reply_cmd(), resurrect_player(), save_life(), save_map(), save_objects(), save_player(), second_arch_pass(), sell_item(), send_exp_table(), send_image_sums(), send_news(), send_rules(), send_skill_info(), send_smooth(), send_spell_paths(), send_tick(), ServiceCtrlHandler(), set_block(), set_csport(), set_face_mode_cmd(), set_ob_key_value_s(), set_owner(), set_up_cmd(), shop_mat_type_move_on(), shop_specialisation_ratio(), should_arena_attack(), skill_ident(), slow_living(), SockList_ReadPacket(), SP_level_spellpoint_cost(), spellbook_type_apply(), spool(), ss_dump_table(), START_TEST(), summon_golem(), summon_object(), swap_below_max(), swap_map(), swap_stat(), tailor_god_spell(), tear_down_wall(), teleport(), tempnam_secure(), thrown_object_type_process(), transmute_materialname(), trigger_connected(), unapply_special(), update_button(), update_buttons(), update_ob_speed(), update_object(), update_position(), use_skill(), value_limit(), verify_button_links(), verify_player(), version_cmd(), write_book_archive(), write_map_log(), write_mark(), write_socket_buffer(), Write_To_Socket(), write_todclock(), and wrong_password().

+ Here is the call graph for this function:

Variable Documentation

const char* const loglevel_names[]
static
Initial value:
= {
"[Error] ",
"[Info] ",
"[Debug] ",
"[Monster] "
}

Human-readable name of log levels.

Definition at line 43 of file logger.c.

Referenced by LOG().