fix syslog bug
This commit is contained in:
		@@ -64,7 +64,7 @@ int main(int argc, char* argv[])
 | 
				
			|||||||
        if (argc > 2)
 | 
					        if (argc > 2)
 | 
				
			||||||
            threads =   atoi(argv[2]);
 | 
					            threads =   atoi(argv[2]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/*
 | 
				
			||||||
        cout << "*******************************************************************************\n";
 | 
					        cout << "*******************************************************************************\n";
 | 
				
			||||||
        cout << "Single thread, " << format(howmany)  << " iterations, auto flush=" << auto_flush << endl;
 | 
					        cout << "Single thread, " << format(howmany)  << " iterations, auto flush=" << auto_flush << endl;
 | 
				
			||||||
        cout << "*******************************************************************************\n";
 | 
					        cout << "*******************************************************************************\n";
 | 
				
			||||||
@@ -87,6 +87,7 @@ int main(int argc, char* argv[])
 | 
				
			|||||||
        bench_mt(howmany, daily_mt, threads);
 | 
					        bench_mt(howmany, daily_mt, threads);
 | 
				
			||||||
        bench(howmany, spdlog::create<null_sink_st>("null_mt"));
 | 
					        bench(howmany, spdlog::create<null_sink_st>("null_mt"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							*/
 | 
				
			||||||
        cout << "\n*******************************************************************************\n";
 | 
					        cout << "\n*******************************************************************************\n";
 | 
				
			||||||
        cout << "async logging.. " << threads << " threads sharing same logger, " << format(howmany) << " iterations, auto_flush=" << auto_flush << endl;
 | 
					        cout << "async logging.. " << threads << " threads sharing same logger, " << format(howmany) << " iterations, auto_flush=" << auto_flush << endl;
 | 
				
			||||||
        cout << "*******************************************************************************\n";
 | 
					        cout << "*******************************************************************************\n";
 | 
				
			||||||
@@ -96,7 +97,8 @@ int main(int argc, char* argv[])
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        for(int i = 0; i < 5; ++i)
 | 
					        for(int i = 0; i < 5; ++i)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            auto as = spdlog::daily_logger_st("as", "logs/daily_async", auto_flush);
 | 
					            //auto as = spdlog::daily_logger_st("as", "logs/daily_async", auto_flush);
 | 
				
			||||||
 | 
					            auto as = spdlog::create<null_sink_st>("as");
 | 
				
			||||||
            bench_mt(howmany, as, threads);
 | 
					            bench_mt(howmany, as, threads);
 | 
				
			||||||
            spdlog::drop("as");
 | 
					            spdlog::drop("as");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,8 +58,6 @@ public:
 | 
				
			|||||||
        _priorities[static_cast<int>(level::CRITICAL)] = LOG_CRIT;
 | 
					        _priorities[static_cast<int>(level::CRITICAL)] = LOG_CRIT;
 | 
				
			||||||
        _priorities[static_cast<int>(level::ALERT)] = LOG_ALERT;
 | 
					        _priorities[static_cast<int>(level::ALERT)] = LOG_ALERT;
 | 
				
			||||||
        _priorities[static_cast<int>(level::EMERG)] = LOG_EMERG;
 | 
					        _priorities[static_cast<int>(level::EMERG)] = LOG_EMERG;
 | 
				
			||||||
 | 
					 | 
				
			||||||
        _priorities[static_cast<int>(level::ALWAYS)] = LOG_INFO;
 | 
					 | 
				
			||||||
        _priorities[static_cast<int>(level::OFF)] = LOG_INFO;
 | 
					        _priorities[static_cast<int>(level::OFF)] = LOG_INFO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ::openlog(ident.c_str(), option, syslog_facility_from_name(facility));
 | 
					        ::openlog(ident.c_str(), option, syslog_facility_from_name(facility));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user