mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 09:59:33 +08:00
Add a syslog() based sink for Linux.
This commit introduce a new sink: syslog_sink. This sink is Linux only, and will write log entries to the system logger, using the syslog() library call. It is instanciable using spdlog::syslog_logger(name). Note that the suffix _st or _mt is not present, as syslog() is thread-safe. I also applied @gabime reviews and added license header.
This commit is contained in:
@@ -64,6 +64,10 @@ int main(int, char* [])
|
||||
SPDLOG_TRACE(file_logger, "This is a trace message (only #ifdef _DEBUG)", 123);
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
auto syslog_logger = spd::syslog_logger("syslog");
|
||||
syslog_logger->warn("This is warning that will end up in syslog. This is Linux only!");
|
||||
#endif
|
||||
}
|
||||
catch (const spd::spdlog_ex& ex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user