updated example

This commit is contained in:
gabime
2014-12-21 02:30:33 +02:00
parent 616cce5b71
commit 14273418d9
2 changed files with 41 additions and 13 deletions

View File

@@ -75,14 +75,15 @@ int main(int, char* [])
auto async_file= spd::daily_logger_st("async_file_logger", "logs/async_log.txt");
async_file->info() << "This is async log.." << "Should be very fast!";
//
// syslog example
//
#ifdef __linux__
std::string ident = "my_app";
auto syslog_logger = spd::syslog_logger("syslog", ident, LOG_PID | LOG_PERROR);
syslog_logger->warn("This is warning that will end up in syslog. This is Linux only!");
// syslog example
std::string ident = "spdlog-example";
auto syslog_logger = spd::syslog_logger("syslog", ident, LOG_PID);
syslog_logger->warn("This is warning that will end up in syslog. This is Linux only!");
#endif
}
catch (const spd::spdlog_ex& ex)
{