Skip to content

Commit

Permalink
support lowcase log config
Browse files Browse the repository at this point in the history
  • Loading branch information
avp-avp committed Jan 28, 2017
1 parent 4a252fc commit 83ec0ef
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions libutils/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ LogParam::LogParam()
#ifdef USE_CONFIG
LogParam::LogParam(CConfigItem node)
{
FileName = node.getStr("FileName");
LogTime = (node.getStr("LogTime", false, "yes")=="yes")?true:false;
ConsoleLevel = node.getInt("ConsoleLevel", false, -1);
FileLevel = node.getInt("FileLevel", false, 0);
FileName = node.getStr("FileName", false, node.getStr("file_name"));
LogTime = (node.getStr("LogTime", false, node.getStr("log_time", false, "yes"))=="yes")?true:false;
ConsoleLevel = node.getInt("ConsoleLevel", false, node.getInt("console_level", false, -1));
FileLevel = node.getInt("FileLevel", false, node.getInt("file_level", false, 0));
}
#endif

Expand Down Expand Up @@ -112,10 +112,13 @@ void CLog::Init(CConfigItem *Config)
{
CConfigItemList nodes;
Config->getList("Log", nodes);

if (nodes.size()==0)
Config->getList("log", nodes);

for(CConfigItemList::iterator i=nodes.begin();i!=nodes.end();i++)
{
m_LogsCfg[(*i)->getStr("Name")] = LogParam(**i);
m_LogsCfg[(*i)->getStr("Name", false, (*i)->getStr("name"))] = LogParam(**i);
}
}
#endif
Expand Down

0 comments on commit 83ec0ef

Please sign in to comment.