summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/log/config/native-syslog
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/log/config/native-syslog
parentInitial commit. (diff)
downloadceph-upstream.tar.xz
ceph-upstream.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/log/config/native-syslog')
-rw-r--r--src/boost/libs/log/config/native-syslog/Jamfile.jam19
-rw-r--r--src/boost/libs/log/config/native-syslog/native_syslog.cpp26
2 files changed, 45 insertions, 0 deletions
diff --git a/src/boost/libs/log/config/native-syslog/Jamfile.jam b/src/boost/libs/log/config/native-syslog/Jamfile.jam
new file mode 100644
index 00000000..fa5dfcd0
--- /dev/null
+++ b/src/boost/libs/log/config/native-syslog/Jamfile.jam
@@ -0,0 +1,19 @@
+#
+# Copyright Andrey Semashev 2016.
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import project ;
+import log-platform-config ;
+
+project /boost/log/native-syslog
+ : source-location .
+ : requirements
+ <conditional>@log-platform-config.set-platform-defines
+
+ <pch>off
+ ;
+
+obj native_syslog : native_syslog.cpp ;
diff --git a/src/boost/libs/log/config/native-syslog/native_syslog.cpp b/src/boost/libs/log/config/native-syslog/native_syslog.cpp
new file mode 100644
index 00000000..25605a68
--- /dev/null
+++ b/src/boost/libs/log/config/native-syslog/native_syslog.cpp
@@ -0,0 +1,26 @@
+/*
+ * Copyright Andrey Semashev 2016.
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#include <syslog.h>
+
+int main(int, char*[])
+{
+ ::openlog("test", LOG_NDELAY, LOG_USER);
+
+ ::syslog(LOG_USER | LOG_DEBUG, "debug message");
+ ::syslog(LOG_USER | LOG_INFO, "info message");
+ ::syslog(LOG_USER | LOG_NOTICE, "notice message");
+ ::syslog(LOG_USER | LOG_WARNING, "warning message");
+ ::syslog(LOG_USER | LOG_ERR, "error message");
+ ::syslog(LOG_USER | LOG_CRIT, "critical message");
+ ::syslog(LOG_USER | LOG_ALERT, "alert message");
+ ::syslog(LOG_USER | LOG_EMERG, "emergency message");
+
+ ::closelog();
+
+ return 0;
+}