00001 #include <tools/log.h> 00002 #include "conf.h" 00003 00004 ConfigImpl Config::conf; 00005 00006 void Config::Init() 00007 { 00008 if(!conf.IsLoaded()) 00009 { 00010 conf.SetDefaultString("log_debug", "none"); 00011 conf.SetDefaultString("log_panic", "stderr"); 00012 conf.SetDefaultString("log_error", "stderr"); 00013 conf.SetDefaultString("log_warning", "stderr"); 00014 conf.SetDefaultString("log_info", "stderr"); 00015 } 00016 } 00017 00018 void Config::LoadFromStandardPath(std::string filename) 00019 { 00020 conf.Load(std::string(ETC_DIR "/") + filename); 00021 00022 if(getenv("HOME")) 00023 conf.Load(std::string(getenv("HOME")) + std::string("/.") + filename); 00024 ReloadLog(); 00025 } 00026 00027 void Config::Load(std::string filename) 00028 { 00029 conf.Load(filename); 00030 ReloadLog(); 00031 } 00032 00033 void Config::ReloadLog() 00034 { 00035 conf.Lock(); 00036 __libldsw_thread_log.Reload(); 00037 conf.Unlock(); 00038 }
1.5.8