Crossfire Server, Trunk  R20513
Functions | Variables
logger.c File Reference

This handles logging, to file or strerr/stdout. More...

#include "global.h"
#include <stdarg.h>
#include <stdlib.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,...)
 Logs a message to stderr, or to file. More...
 

Variables

static const char *const loglevel_names []
 Human-readable name of log levels. More...
 
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 51 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 account_add_player_cmd(), account_char_load(), account_login_cmd(), account_new_cmd(), account_password(), account_play_cmd(), accounts_load(), add_abilities(), add_book(), add_book_to_list(), add_button_link(), add_friendly_object(), add_god_to_list(), add_object_to_socklist(), add_one_item(), 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_describe(), ask_smooth_cmd(), assign_region_parents(), attempt_do_alchemy(), attempt_recipe(), block_until_new_connection(), blocked_link(), calc_alch_danger(), calc_skill_exp(), 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(), cfapi_player_knowledge(), cfapi_player_quest(), change_attr_value(), change_book(), change_exp(), change_object(), check_altar_sacrifice(), check_faceset_fallback(), check_formulae(), check_generators(), check_login(), check_recipe(), check_spell_knockback(), check_spells(), check_summoned(), check_treasurelist(), check_trigger(), checkbanned(), checkdm(), choose_cult_monster(), clean_friendly_list(), clean_tmp_files(), cleanup(), command_arrest(), command_banish(), command_create(), command_help(), command_knowledge(), command_loadplugin(), command_pickup(), command_quest(), command_reset(), command_shutdown(), command_unloadplugin(), command_whereabouts(), common_ob_move_on(), common_pre_ob_move_on(), common_process_projectile(), content_recipe_value(), convert_item(), copy_file(), create_one_treasure(), create_player_cmd(), create_treasure(), dead_player(), deathstrike_living(), deep_swamp_type_process(), delete_map(), determine_holy_arch(), die_roll(), display_who_entry(), do_execute_event(), do_forget_spell(), do_harvest(), do_learn_spell(), do_mood_floor(), do_server(), do_skill(), do_skill_attack(), do_throw(), dragon_ability_gain(), draw_client_map(), draw_ext_info(), draw_magic_map(), dump_alchemy(), dump_alchemy_costs(), dump_all_archetypes(), dump_friendly_objects(), dump_map(), emergency_save(), enter_exit(), enter_fixed_template_map(), enter_map(), enter_player_maplevel(), 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(), examine_cmd(), execute_newserver_command(), expand_lighted_sight(), explode_bullet(), find_animation(), find_archetype(), find_color(), find_doors_in_room_recursive(), find_recipe(), find_skill_by_name(), find_throw_ob(), find_title(), find_transmution_ob(), find_treasurelist(), fire_arch_from_position(), fire_bow(), fire_misc_object(), fix_flesh_item(), fix_generated_item(), fix_object(), fix_summon_pet(), fix_weight(), flee_player(), flush_old_maps(), follower_level_to_enchantments(), food_type_apply(), forbid_play(), free_all_archs(), free_all_god(), free_all_maps(), free_all_newserver(), free_all_objects(), free_all_readable(), free_all_recipes(), free_map(), free_newsocket(), 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_player_archetype(), get_rand_god(), get_random_mon(), get_random_recipelist(), get_region_by_name(), get_region_longname(), get_region_msg(), get_titlelist(), get_typedata_by_name(), give_initial_items(), give_skill_by_name(), god_enchants_weapon(), god_info_msg(), god_intervention(), handle_cmd(), hiscore_display(), hiscore_load(), hiscore_save(), hit_map(), hit_player(), hit_with_one_attacktype(), i18n_init(), identify_altar_type_move_on(), improve_armour(), improve_weapon(), init(), 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_globals(), init_gods(), init_library(), init_listening_socket(), init_mon_info(), init_msgfile(), init_races(), init_readable(), init_regions(), init_server(), init_skills(), init_startup(), init_stats(), initPlugins(), inscribe_scroll_cmd(), key_change_class(), key_roll_stat(), kill_object(), knowledge_alchemy_attempt(), knowledge_alchemy_face(), knowledge_give(), knowledge_god_add(), knowledge_god_detail(), knowledge_god_validate(), knowledge_player_knows(), knowledge_read_player_data(), learn_skill(), leave(), legal_artifact_combination(), level_for_item(), link_player_skills(), load_archetypes(), load_map_header(), load_materials(), load_objects(), load_overlay_map(), load_quests_from_file(), load_settings(), load_table_float(), load_table_int(), load_temporary_map(), load_treasure(), load_treasures(), load_unique_objects(), QuestManager::loadQuestFile(), local_check_loaded_object(), lock_item_cmd(), LOG(), look_at_cmd(), 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(), map_find_by_archetype(), map_find_by_type(), mapfile_load(), mark_item_cmd(), metaserver2_init(), metaserver2_writer(), monster_can_detect_enemy(), monster_cast_spell(), monster_check_apply(), monster_communicate(), monster_find_nearest_living_creature(), monster_find_throw_ob(), monster_move(), monster_use_bow(), monster_use_range(), monster_use_skill(), mood_change(), move_cmd(), move_cone(), move_creator(), move_detector(), move_duplicator(), move_firewall(), move_player(), move_player_mover(), move_symptom(), move_teleporter(), new_connection(), new_player_cmd(), numb_ob_inside(), object_dump_all(), object_fix_multipart(), object_free2(), object_free_all_data(), object_get_owner_const(), object_insert_in_map(), object_insert_in_ob(), object_merge_spell(), object_new(), object_remove(), object_set_enemy(), object_split(), object_update(), object_update_speed(), of_close(), of_open(), operate_altar(), parse_dialog_information(), parse_regions(), parse_shop_string(), party_remove(), path_combine(), path_normalize(), pay_for_amount(), pay_for_item(), pay_from_container(), peacemaker_type_process(), pets_follow_owner(), pets_move(), pets_move_golem(), pets_remove_all(), pets_should_arena_attack(), pets_summon_golem(), pets_summon_object(), 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(), price_approx(), process_events(), query_base_name(), query_money(), query_short_name(), quest_get(), quest_get_step(), quest_load_definitions(), quest_read_player_data(), quest_set_state(), quest_start(), random_roll(), random_roll64(), read_bmap_names(), read_client_images(), read_face_data(), read_map_log(), read_smooth(), receive_player_password(), remove_button_link(), remove_directory(), remove_friendly_object(), remove_special_prayers(), reply_cmd(), request_info_cmd(), resurrect_player(), save_life(), save_map(), save_object(), save_objects(), save_player(), save_throw_object(), second_arch_pass(), sell_item(), send_arch_info(), send_exp_table(), send_face_cmd(), send_file(), send_image_sums(), send_news(), send_rules(), send_skill_info(), send_smooth(), send_spell_paths(), send_tick(), Send_With_Handling(), ServiceCtrlHandler(), set_block(), set_csport(), set_up_cmd(), shop_mat_type_move_on(), shop_specialisation_ratio(), skill_ident(), slow_living(), SockList_ReadPacket(), SP_level_spellpoint_cost(), spellbook_type_apply(), ss_dump_table(), START_TEST(), 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_position(), use_skill(), value_limit(), verify_button_links(), verify_player(), version_cmd(), write_book_archive(), write_mark(), write_socket_buffer(), Write_To_Socket(), and wrong_password().

Here is the call graph for this function:

Variable Documentation

const char* const loglevel_names[]
static
Initial value:
= {
"[EE] ",
"[II] ",
"[DD] ",
"[MM] ",
}

Human-readable name of log levels.

Definition at line 31 of file logger.c.

Referenced by LOG().