Commit 3bf24d0d authored by Pavel Vainerman's avatar Pavel Vainerman

(Configuration): rename initDebug() ==> initLogStream()

parent 678ebcd6
......@@ -633,7 +633,7 @@ end_private(false)
{
ostringstream s;
s << myname << "-log";
conf->initDebug(mylog,s.str());
conf->initLogStream(mylog,s.str());
}
<xsl:for-each select="//smap/item">
......@@ -963,7 +963,7 @@ askPause(uniset_conf()->getPIntProp(cnode,"askPause",2000))
{
ostringstream s;
s &lt;&lt; myname &lt;&lt; "-log";
conf->initDebug(mylog, s.str());
conf->initLogStream(mylog, s.str());
}
si.node = conf->getLocalNode();
......
......@@ -13,9 +13,7 @@ int main( int argc, const char **argv )
string logfilename = conf->getArgParam("--logfile", "Skel.log");
string logname( conf->getLogDir() + logfilename );
// dlog.logFile( logname.c_str() );
ulog.logFile( logname.c_str() );
// conf->initDebug(dlog,"dlog");
auto act = UniSetActivator::Instance();
xmlNode* cnode = conf->getNode("Skel");
......
......@@ -18,9 +18,11 @@ namespace UniSetExtensions
_dlog = make_shared<DebugStream>();
_dlog->setLogName("dlog");
auto conf = uniset_conf();
if( conf )
conf->initDebug(_dlog,"dlog");
conf->initLogStream(_dlog,"dlog");
return _dlog;
}
......
......@@ -141,9 +141,9 @@ namespace UniSetTypes
int getArgPInt(const std::string& name, int defval);
int getArgPInt(const std::string& name, const std::string& strdefval, int defval);
xmlNode* initDebug( DebugStream& deb, const std::string& nodename );
xmlNode* initDebug( std::shared_ptr<DebugStream> deb, const std::string& nodename );
xmlNode* initDebug( DebugStream* deb, const std::string& nodename );
xmlNode* initLogStream( DebugStream& deb, const std::string& nodename );
xmlNode* initLogStream( std::shared_ptr<DebugStream> deb, const std::string& nodename );
xmlNode* initLogStream( DebugStream* deb, const std::string& nodename );
UniSetTypes::ListOfNode::const_iterator listNodesBegin()
{
......
......@@ -1261,7 +1261,7 @@ mbErrCode ModbusClient::send( ModbusMessage& msg )
void ModbusClient::initLog( UniSetTypes::Configuration* conf,
const std::string& lname, const string& logfile )
{
conf->initDebug(dlog,lname);
conf->initLogStream(dlog,lname);
if( !logfile.empty() )
dlog->logFile( logfile );
......
......@@ -1385,7 +1385,7 @@ void ModbusServer::setLog( std::shared_ptr<DebugStream> l )
void ModbusServer::initLog( UniSetTypes::Configuration* conf,
const std::string& lname, const string& logfile )
{
conf->initDebug(dlog,lname);
conf->initLogStream(dlog,lname);
if( !logfile.empty() )
dlog->logFile( logfile );
......
......@@ -266,7 +266,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
}
// Настраиваем отладочные логи
initDebug(ulog(),"UniSetDebug");
initLogStream(ulog(),"UniSetDebug");
// default init...
transientIOR = false;
......@@ -729,27 +729,27 @@ string Configuration::getPropByNodeName(const string& nodename, const string& pr
return getProp(node,prop);
}
// -------------------------------------------------------------------------
xmlNode* Configuration::initDebug( std::shared_ptr<DebugStream> deb, const string& _debname )
xmlNode* Configuration::initLogStream( std::shared_ptr<DebugStream> deb, const string& _debname )
{
if( !deb )
return NULL;
return initDebug( deb.get(), _debname );
return initLogStream( deb.get(), _debname );
}
// -------------------------------------------------------------------------
xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
xmlNode* Configuration::initLogStream( DebugStream& deb, const string& _debname )
{
return initDebug(&deb, _debname);
return initLogStream(&deb, _debname);
}
// -------------------------------------------------------------------------
xmlNode* Configuration::initDebug( DebugStream* deb, const string& _debname )
xmlNode* Configuration::initLogStream( DebugStream* deb, const string& _debname )
{
if( !deb )
return NULL;
if( _debname.empty() )
{
deb->any() << "(Configuration)(initDebug): INIT DEBUG FAILED!!!" << endl;
deb->any() << "(Configuration)(initLogStream): INIT DEBUG FAILED!!!" << endl;
return 0;
}
......@@ -758,7 +758,7 @@ xmlNode* Configuration::initDebug( DebugStream* deb, const string& _debname )
xmlNode* dnode = getNode(_debname);
if( dnode == NULL )
deb->any() << "(Configuration)(initDebug): WARNING! Not found conf. section for log '" << _debname << "'" << endl;
deb->any() << "(Configuration)(initLogStream): WARNING! Not found conf. section for log '" << _debname << "'" << endl;
else
{
if( !getProp(dnode,"name").empty() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment