Commit 06161ca0 authored by Pavel Vainerman's avatar Pavel Vainerman

Убрал везде вызов conf->initDebug(dlog()).. т.к. он встроен в dlog().

И другие незначительные правки..
parent 51bb5408
......@@ -81,22 +81,22 @@ int main( int argc, char **argv )
// dlog.addLevel( Debug::type(Debug::CRIT | Debug::WARN | Debug::INFO) );
}
LogAgregator la;
auto dlog = make_shared<DebugStream>();
dlog->setLogName("dlog");
auto dlog2 = make_shared<DebugStream>();
dlog2->setLogName("dlog2");
LogAgregator la;
la.add(dlog);
la.add(dlog2);
auto dlog2 = la.create("dlog2");
LogServer ls(la);
// LogServer ls(cout);
dlog->addLevel(Debug::ANY);
dlog2->addLevel(Debug::ANY);
ls.run( addr, port, true );
#if 0
unsigned int i=0;
while( true )
......@@ -112,6 +112,7 @@ int main( int argc, char **argv )
msleep(delay);
}
#endif
}
catch( SystemError& err )
{
......
......@@ -31,10 +31,10 @@ int main( int argc, const char **argv )
SystemMessage sm(SystemMessage::StartUp);
act.broadcast( sm.transport_msg() );
ulog << "\n\n\n";
ulog << "(Skel::main): -------------- Skel START -------------------------\n\n";
dlog << "\n\n\n";
dlog << "(Skel::main): -------------- Skel START -------------------------\n\n";
ulogany << "\n\n\n";
ulogany << "(Skel::main): -------------- Skel START -------------------------\n\n";
dlogany << "\n\n\n";
dlogany << "(Skel::main): -------------- Skel START -------------------------\n\n";
act->run(false);
}
catch(SystemError& err)
......
......@@ -42,7 +42,7 @@
<item name="input1_s" vartype="in" comment="comment for input1" smTestID="1"/>
<item name="input2_s" vartype="in" comment="comment for input2" />
<item name="output1_c" vartype="out" omment="comment for output1" no_check_id="1"/>
<item name="loglevel_s" vartype="in" comment="log level control" loglevel="1"/>
<!-- <item name="loglevel_s" vartype="in" comment="log level control" loglevel="1"/> -->
</smap>
<msgmap>
......
......@@ -24,7 +24,6 @@ int main(int argc, const char **argv)
{
auto conf = uniset_init(argc, argv);
conf->initDebug(dlog(),"dlog");
string logfilename = conf->getArgParam("--io-logfile","iocontrol.log");
string logname( conf->getLogDir() + logfilename );
dlog()->logFile( logname );
......
......@@ -18,8 +18,6 @@ int main(int argc, const char **argv)
if( logfilename.empty() )
logfilename = "logicproc.log";
conf->initDebug(dlog(),"dlog");
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
......
......@@ -20,8 +20,6 @@ int main(int argc, const char **argv)
if( logfilename.empty() )
logfilename = "logicproc.log";
conf->initDebug(dlog(),"dlog");
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
......
......@@ -30,8 +30,6 @@ int main( int argc, const char** argv )
if( logfilename.empty() )
logfilename = "mbtcpmaster.log";
conf->initDebug(dlog(),"dlog");
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
......
......@@ -29,8 +29,6 @@ int main( int argc, const char** argv )
if( logfilename.empty() )
logfilename = "mbtcpmultimaster.log";
conf->initDebug(dlog(),"dlog");
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
......
......@@ -28,8 +28,6 @@ int main( int argc, char** argv )
if( logfilename.empty() )
logfilename = "rtuexchange.log";
conf->initDebug(dlog(),"dlog");
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
......
......@@ -32,7 +32,6 @@ int main(int argc, char* argv[] )
try
{
auto conf = uniset_init(argc,argv);
conf->initDebug(dlog(),"dlog");
dlog()->logFile("./smtest.log");
bool apart = findArgParam("--apart",argc,argv) != -1;
......
......@@ -32,7 +32,6 @@ int main(int argc, char* argv[] )
try
{
auto conf = uniset_init(argc,argv);
conf->initDebug(dlog(),"dlog");
dlog()->logFile("./smtest.log");
bool apart = findArgParam("--apart",argc,argv) != -1;
......
......@@ -17,7 +17,7 @@ static ModbusRTU::ModbusAddr slaveADDR = 0x01;
static shared_ptr<MBTCPTestServer> mbs;
static shared_ptr<UInterface> ui;
static ObjectId mbID = 6004; // MBTCPMaster1
static int polltime=50; // conf->getArgInt("--mbtcp-polltime");
static int polltime=100; // conf->getArgInt("--mbtcp-polltime");
static ObjectId slaveNotRespond = 10; // Slave_Not_Respond_S
static const ObjectId exchangeMode = 11; // MBTCPMaster_Mode_AS
// -----------------------------------------------------------------------------
......
......@@ -30,7 +30,7 @@ static shared_ptr<MBTCPTestServer> mbs1;
static shared_ptr<MBTCPTestServer> mbs2;
static shared_ptr<UInterface> ui;
static ObjectId mbID = 6005; // MBTCPMultiMaster1
static int polltime=50; // conf->getArgInt("--mbtcp-polltime");
static int polltime=100; // conf->getArgInt("--mbtcp-polltime");
static ObjectId slaveNotRespond = 10; // Slave_Not_Respond_S
static ObjectId slave1NotRespond = 12; // Slave1_Not_Respond_S
static ObjectId slave2NotRespond = 13; // Slave2_Not_Respond_S
......
......@@ -40,8 +40,6 @@ int main(int argc, const char **argv)
ulog()->logFile( logname.str() );
dlog()->logFile( logname.str() );
conf->initDebug(dlog(),"dlog");
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
if( !sID.empty() )
......
......@@ -40,8 +40,6 @@ int main(int argc, const char **argv)
ulog()->logFile( logname.str() );
dlog()->logFile( logname.str() );
conf->initDebug(dlog(),"dlog");
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
if( !sID.empty() )
......
......@@ -32,7 +32,6 @@ int main(int argc, char* argv[] )
try
{
auto conf = uniset_init(argc,argv);
conf->initDebug(dlog(),"dlog");
bool apart = findArgParam("--apart",argc,argv) != -1;
......
......@@ -30,8 +30,6 @@ int main( int argc, const char** argv )
if( logfilename.empty() )
logfilename = "rrdstorage.log";
conf->initDebug(dlog(),"dlog");
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
......
......@@ -29,8 +29,6 @@ int main( int argc, const char** argv )
if( logfilename.empty() )
logfilename = "smdbserver.log";
conf->initDebug(dlog,"dlog");
std::ostringstream logname;
string dir(conf->getLogDir());
logname << dir << logfilename;
......
......@@ -23,7 +23,6 @@ int main(int argc, const char **argv)
{
auto conf = uniset_init(argc, argv);
conf->initDebug(dlog(),"dlog");
string logfilename = conf->getArgParam("--logfile", "smemory.log");
string logname( conf->getLogDir() + logfilename );
ulog()->logFile( logname );
......
......@@ -74,7 +74,7 @@ int main( int argc, const char **argv )
string logname( conf->getLogDir() + logfilename );
UniSetExtensions::dlog()->logFile( logname );
ulog()->logFile( logname );
conf->initDebug(UniSetExtensions::dlog(),"dlog");
dlog()->logFile( logname );
auto act = UniSetActivator::Instance();
act->signal_terminate_event().connect( &activator_terminate );
......
......@@ -32,7 +32,6 @@ int main(int argc, char* argv[] )
try
{
uniset_init(argc,argv);
conf->initDebug(dlog,"dlog");
UNetExchange* unet = UNetExchange::init_unetexchange(argc,argv,getSharedMemoryID());
if( !unet )
......
......@@ -32,7 +32,6 @@ int main(int argc, char* argv[] )
try
{
auto conf = uniset_init(argc,argv);
conf->initDebug(dlog(),"dlog");
bool apart = findArgParam("--apart",argc,argv) != -1;
......
......@@ -34,7 +34,6 @@ int main( int argc, const char** argv )
logname << dir << logfilename;
ulog()->logFile( logname.str() );
UniSetExtensions::dlog()->logFile( logname.str() );
conf->initDebug(UniSetExtensions::dlog(),"dlog");
ObjectId shmID = DefaultObjectId;
string sID = conf->getArgParam("--smemory-id");
......
......@@ -21,7 +21,6 @@ int main(int argc, const char **argv)
{
auto conf = uniset_init(argc, argv);
conf->initDebug(dlog(),"dlog");
string logfilename = conf->getArgParam("--logfile", "smemory.log");
string logname( conf->getLogDir() + logfilename );
ulog()->logFile( logname );
......
......@@ -15,7 +15,13 @@ namespace UniSetExtensions
{
if( _dlog )
return _dlog;
_dlog = make_shared<DebugStream>();
auto conf = uniset_conf();
if( conf )
conf->initDebug(_dlog,"dlog");
return _dlog;
}
// -------------------------------------------------------------------------
......
......@@ -23,11 +23,10 @@ int main(int argc, const char **argv)
string confile = UniSetTypes::getArgParam( "--confile", argc, argv, "configure.xml" );
conf = new Configuration(argc, argv, confile);
conf->initDebug(dlog,"dlog");
string logfilename = conf->getArgParam("--logfile", "smemory.log");
string logname( conf->getLogDir() + logfilename );
ulog.logFile( logname );
dlog.logFile( logname );
ulog()->logFile( logname );
dlog()->logFile( logname );
auto shm = SharedMemory::init_smemory(argc, argv);
if( !shm )
......
......@@ -75,7 +75,7 @@ ostream& UniSetTypes::Configuration::help(ostream& os)
namespace UniSetTypes
{
static shared_ptr<Configuration> uconf;
static std::shared_ptr<DebugStream> _ulog;
static std::shared_ptr<DebugStream> _ulog = nullptr;
std::shared_ptr<DebugStream> ulog()
{
......@@ -83,6 +83,7 @@ namespace UniSetTypes
return _ulog;
_ulog = make_shared<DebugStream>();
_ulog->setLogName("ulog");
return _ulog;
}
......@@ -1056,8 +1057,6 @@ std::shared_ptr<Configuration> uniset_init( int argc, const char* const* argv, c
atexit( UniSetActivator::normalexit );
set_terminate( UniSetActivator::normalterminate ); // ловушка для неизвестных исключений
ulog()->setLogName("ulog");
string confile = UniSetTypes::getArgParam( "--confile", argc, argv, xmlfile );
UniSetTypes::uconf = make_shared<Configuration>(argc, argv, confile);
return UniSetTypes::uconf;
......
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