Commit 63977bf7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

use logFile with string, without c_str

parent c5dd48ca
......@@ -1163,7 +1163,7 @@ void IOControl::sysCommand( SystemMessage* sm )
string fname = unideb.getLogFile();
if( !fname.empty() )
{
unideb.logFile(fname.c_str());
unideb.logFile(fname);
unideb << myname << "(sysCommand): ***************** UNIDEB LOG ROTATE *****************" << endl;
}
......@@ -1171,7 +1171,7 @@ void IOControl::sysCommand( SystemMessage* sm )
fname = unideb.getLogFile();
if( !fname.empty() )
{
unideb.logFile(fname.c_str());
unideb.logFile(fname);
unideb << myname << "(sysCommand): ***************** GGDEB LOG ROTATE *****************" << endl;
}
}
......
......@@ -29,8 +29,8 @@ int main(int argc, const char **argv)
conf->initDebug(dlog,"dlog");
string logfilename = conf->getArgParam("--io-logfile","iocontrol.log");
string logname( conf->getLogDir() + logfilename );
dlog.logFile( logname.c_str() );
unideb.logFile( logname.c_str() );
dlog.logFile( logname );
unideb.logFile( logname );
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
......
......@@ -126,7 +126,7 @@ void PassiveLProcessor::sysCommand( UniSetTypes::SystemMessage *sm )
string fname = unideb.getLogFile();
if( !fname.empty() )
{
unideb.logFile(fname.c_str());
unideb.logFile(fname);
unideb << myname << "(sysCommand): ***************** UNIDEB LOG ROTATE *****************" << std::endl;
}
......@@ -134,7 +134,7 @@ void PassiveLProcessor::sysCommand( UniSetTypes::SystemMessage *sm )
fname = dlog.getLogFile();
if( !fname.empty() )
{
dlog.logFile(fname.c_str());
dlog.logFile(fname);
dlog << myname << "(sysCommand): ***************** dlog LOG ROTATE *****************" << std::endl;
}
}
......
......@@ -23,8 +23,8 @@ int main(int argc, const char **argv)
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
unideb.logFile( logname.str().c_str() );
dlog.logFile( logname.str().c_str() );
unideb.logFile( logname.str() );
dlog.logFile( logname.str() );
string schema = conf->getArgParam("--schema");
if( schema.empty() )
......
......@@ -37,8 +37,8 @@ int main( int argc, const char** argv )
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
unideb.logFile( logname.str().c_str() );
dlog.logFile( logname.str().c_str() );
unideb.logFile( logname.str() );
dlog.logFile( logname.str() );
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
......
......@@ -491,7 +491,7 @@ void MBSlave::sysCommand(UniSetTypes::SystemMessage *sm)
string fname = unideb.getLogFile();
if( !fname.empty() )
{
unideb.logFile(fname.c_str());
unideb.logFile(fname);
unideb << myname << "(sysCommand): ***************** UNIDEB LOG ROTATE *****************" << std::endl;
}
......@@ -499,7 +499,7 @@ void MBSlave::sysCommand(UniSetTypes::SystemMessage *sm)
fname = dlog.getLogFile();
if( !fname.empty() )
{
dlog.logFile(fname.c_str());
dlog.logFile(fname);
dlog << myname << "(sysCommand): ***************** dlog LOG ROTATE *****************" << std::endl;
}
}
......
......@@ -40,8 +40,8 @@ int main(int argc, const char **argv)
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
unideb.logFile( logname.str().c_str() );
dlog.logFile( logname.str().c_str() );
unideb.logFile( logname.str() );
dlog.logFile( logname.str() );
conf->initDebug(dlog,"dlog");
......
......@@ -730,14 +730,14 @@ void RTUExchange::sysCommand( UniSetTypes::SystemMessage *sm )
string fname = unideb.getLogFile();
if( !fname.empty() )
{
unideb.logFile(fname.c_str());
unideb.logFile(fname);
unideb << myname << "(sysCommand): ***************** UNIDEB LOG ROTATE *****************" << std::endl;
}
dlog << myname << "(sysCommand): logRotate" << std::endl;
fname = dlog.getLogFile();
if( !fname.empty() )
{
dlog.logFile(fname.c_str());
dlog.logFile(fname);
dlog << myname << "(sysCommand): ***************** dlog LOG ROTATE *****************" << std::endl;
}
}
......
......@@ -35,8 +35,8 @@ int main( int argc, char** argv )
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
unideb.logFile( logname.str().c_str() );
dlog.logFile( logname.str().c_str() );
unideb.logFile( logname.str() );
dlog.logFile( logname.str() );
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
......
......@@ -28,8 +28,8 @@ int main(int argc, const char **argv)
conf->initDebug(dlog,"dlog");
string logfilename = conf->getArgParam("--logfile", "smemory.log");
string logname( conf->getLogDir() + logfilename );
unideb.logFile( logname.c_str() );
dlog.logFile( logname.c_str() );
unideb.logFile( logname );
dlog.logFile( logname );
SharedMemory* shm = SharedMemory::init_smemory(argc, argv);
if( !shm )
......
......@@ -35,7 +35,7 @@ int main( int argc, char **argv )
string logfilename = conf->getArgParam("--logfile", "smemory-plus.log");
string logname( conf->getLogDir() + logfilename );
unideb.logFile( logname.c_str() );
unideb.logFile( logname );
ObjectsActivator act;
......
......@@ -403,7 +403,7 @@ void UDPExchange::sysCommand(UniSetTypes::SystemMessage *sm)
string fname = unideb.getLogFile();
if( !fname.empty() )
{
unideb.logFile(fname.c_str());
unideb.logFile(fname);
unideb << myname << "(sysCommand): ***************** UNIDEB LOG ROTATE *****************" << std::endl;
}
......@@ -411,7 +411,7 @@ void UDPExchange::sysCommand(UniSetTypes::SystemMessage *sm)
fname = dlog.getLogFile();
if( !fname.empty() )
{
dlog.logFile(fname.c_str());
dlog.logFile(fname);
dlog << myname << "(sysCommand): ***************** dlog LOG ROTATE *****************" << std::endl;
}
}
......
......@@ -35,8 +35,8 @@ int main( int argc, char** argv )
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
unideb.logFile( logname.str().c_str() );
dlog.logFile( logname.str().c_str() );
unideb.logFile( logname.str() );
dlog.logFile( logname.str() );
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
......
......@@ -25,8 +25,8 @@ int main(int argc, const char **argv)
conf->initDebug(dlog,"dlog");
string logfilename = conf->getArgParam("--logfile", "smemory.log");
string logname( conf->getLogDir() + logfilename );
unideb.logFile( logname.c_str() );
dlog.logFile( logname.c_str() );
unideb.logFile( logname );
dlog.logFile( logname );
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
......
......@@ -1014,7 +1014,7 @@ void ModbusClient::initLog( UniSetTypes::Configuration* conf,
conf->initDebug(dlog,lname);
if( !logfile.empty() )
dlog.logFile( logfile.c_str() );
dlog.logFile( logfile );
}
// -------------------------------------------------------------------------
void ModbusClient::setLog( DebugStream& l )
......
......@@ -1103,7 +1103,7 @@ void ModbusServer::initLog( UniSetTypes::Configuration* conf,
conf->initDebug(dlog,lname);
if( !logfile.empty() )
dlog.logFile( logfile.c_str() );
dlog.logFile( logfile );
}
// -------------------------------------------------------------------------
void ModbusServer::printProcessingTime()
......
......@@ -791,7 +791,7 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
string debug_file(getProp(dnode,"file"));
if( !debug_file.empty() )
deb.logFile(debug_file.c_str());
deb.logFile(debug_file);
}
//
......
......@@ -214,7 +214,7 @@ const DebugStream& DebugStream::operator=( const DebugStream& r )
show_datetime = r.show_datetime;
fname = r.fname;
if( !r.fname.empty() )
logFile(fname.c_str());
logFile(fname);
return *this;
}
......
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