本文整理汇总了C++中LogFile::SetLogSize方法的典型用法代码示例。如果您正苦于以下问题:C++ LogFile::SetLogSize方法的具体用法?C++ LogFile::SetLogSize怎么用?C++ LogFile::SetLogSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogFile
的用法示例。
在下文中一共展示了LogFile::SetLogSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// * ================================================================================ *
// @ main
// * ================================================================================ *
int main(int argc, char ** argv)
{
//open the log file
pLogFile = &CCLogFile;
CCLogFile.startlog(1);
CCLogFile.SetLogSize(2*1000*1000);
CCLogFile.SetLoglevel(1);
CCLogFile.logopen();
if ( myconfig.readfile(CONFIG_FILE_PATH) == 0 )
{
printf("appserver: read config file '%s' error\n", CONFIG_FILE_PATH);
LOG(LOG1, "appserver: read config file '%s' error\n", CONFIG_FILE_PATH);
sleep(2);
exit(0);
}
CCLogFile.SetLoglevel(ToInt(myconfig["LogLevel"][1]));
//TANG 2010-9-4 11:02
//处理命令行参数
if ( argc == 3 && strcmp(argv[1], "reload") == 0 && strcmp(argv[2], "config") == 0 )
{
send_msg_reload_config("127.0.0.1", (( ToInt(myconfig["AppServerListenPort"][1]) > 0 ) ? ToInt(myconfig["AppServerListenPort"][1]) : 4016));
exit(0);
}
LOG(LOG1, "appserver: start\n");
child_process_init(SN3_SERVICE_NUMBER);
//application_envinit();
//LOG(LOG1, "appserver: application_envinit() done\n");
_appserver_initial();
LOG(LOG1, "appserver: _appserver_initial() done\n");
nthread_create(thread_sockserver, NULL, 64*1024);
nthread_create(thread_procdata_sendsmsg, NULL, 64*1024);
tcp_server1.SetpLog(&CCLogFile);
tcp_server1.SetCallBackFunc(deal_client_msg);
if ( ToInt(myconfig["AppServerListenPort"][1]) > 0 )
{
tcp_server1.Listen(ToInt(myconfig["AppServerListenPort"][1]), 180);
}
else
{
tcp_server1.Listen(4016, 180);
}
//NPOSITION pos;
//rundata_realtest* p_runtest;
string s_terminal, s_msg_type;
time_t t_check_hb_timeout = time(NULL);
time_t t_check_test_timeout = time(NULL);
while(g_appserver.m_runing)
{
child_process_hb(SN3_SERVICE_NUMBER);
/*
pos = NULL;
while(NULL != (p_runtest = realtest_next(pos)))
{
if ( time(NULL) >= p_runtest->tm_end )
{
CClientMsg::ansy_getitem(p_runtest->s_testdata.c_str(), "terminal", s_terminal);
CClientMsg::ansy_getitem(p_runtest->s_testdata.c_str(), "msg", s_msg_type);
//PESQ的实时测试,ftp扫描单元可能直接修改数据库的测试结果为X
CNString sql;
sql.Format("select * from BUSSOP where BUSSOP_ID = '%s' and (STATUS != 'X' and STATUS != 'Y');", p_runtest->s_bussopid.c_str());
DATASET dbresult;
if ( DB1.db_select(sql.c_str(), dbresult, LOG6) > 0 )
{
LOG(LOG1, "测试超时 [%s] '%c', s_bussopid='%s', timeout=%ds\n\n",
s_terminal.c_str(),
p_runtest->u_buss,
p_runtest->s_bussopid.c_str(),
p_runtest->tm_end - p_runtest->tm_start
);
int i_rescode = 1;
if ( dbresult[0]["STATUS"] == "W" ) i_rescode = 5001;
appserver_dbupdate_bussop_error(p_runtest->s_bussopid.c_str(), i_rescode);
}
t_uchar u_buss = p_runtest->u_buss;
p_runtest = realtest_next(pos);
//.........这里部分代码省略.........