bool LogerManager::updateConfig() { if (_configFile.empty()) { //LOGW("log4z update config file error. filename is empty."); return false; } Log4zFileHandler f; f.open(_configFile.c_str(), "r"); if (!f.isOpen()) { std::cout << " !!! !!! !!! !!!" << std::endl; std::cout << " !!! !!! log4z load config file error. filename=" << _configFile << " !!! !!! " << std::endl; std::cout << " !!! !!! !!! !!!" << std::endl; return false; } return configFromStringImpl(f.readContent().c_str(), true); }
bool LogerManager::updateConfig() { if (_configFile.empty()) { //LOGW("log4z update config file error. filename is empty."); return false; } Log4zFileHandler f; f.open(_configFile.c_str(), "rb"); if (!f.isOpen()) { printf(" !!! !!! !!! !!!\r\n"); printf(" !!! !!! log4z load config file error. filename=%s !!! !!! \r\n", _configFile.c_str()); printf(" !!! !!! !!! !!!\r\n"); return false; } return configFromStringImpl(f.readContent().c_str(), true); }
//! read configure and create with overwriting bool LogerManager::config(const char* configPath) { if (!_configFile.empty()) { std::cout << " !!! !!! !!! !!!" << std::endl; std::cout << " !!! !!! log4z configure error: too many calls to Config. the old config file=" << _configFile << ", the new config file=" << configPath << " !!! !!! " << std::endl; std::cout << " !!! !!! !!! !!!" << std::endl; return false; } _configFile = configPath; Log4zFileHandler f; f.open(_configFile.c_str(), "r"); if (!f.isOpen()) { std::cout << " !!! !!! !!! !!!" << std::endl; std::cout << " !!! !!! log4z load config file error. filename=" << configPath << " !!! !!! " << std::endl; std::cout << " !!! !!! !!! !!!" << std::endl; return false; } return configFromStringImpl(f.readContent().c_str(), false); }
//! read configure and create with overwriting bool LogerManager::config(const char* configPath) { if (!_configFile.empty()) { printf(" !!! !!! !!! !!!\r\n"); printf(" !!! !!! log4z configure error: too many calls to Config. the old config file=%s, the new config file=%s !!! !!! \r\n" , _configFile.c_str(), configPath); printf(" !!! !!! !!! !!!\r\n"); return false; } _configFile = configPath; Log4zFileHandler f; f.open(_configFile.c_str(), "rb"); if (!f.isOpen()) { printf(" !!! !!! !!! !!!\r\n"); printf(" !!! !!! log4z load config file error. filename=%s !!! !!! \r\n", configPath); printf(" !!! !!! !!! !!!\r\n"); return false; } return configFromStringImpl(f.readContent().c_str(), false); }