2 .TH "SD\-DAEMON" "3" "" "systemd 214" "sd-daemon"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
17 .\" disable justification (adjust text to left margin only)
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
23 sd-daemon, SD_EMERG, SD_ALERT, SD_CRIT, SD_ERR, SD_WARNING, SD_NOTICE, SD_INFO, SD_DEBUG \- APIs for new\-style daemons
28 #include <systemd/sd\-daemon\&.h>
31 .HP \w'\fBpkg\-config\ \-\-cflags\ \-\-libs\ libsystemd\fR\ 'u
32 \fBpkg\-config \-\-cflags \-\-libs libsystemd\fR
36 provide APIs for new\-style daemons, as implemented by the
41 \fBsd_listen_fds\fR(3),
45 \fBsd_watchdog_enabled\fR(3)
46 for more information about the functions implemented\&. In addition to these functions, a couple of logging prefixes are defined as macros:
52 #define SD_EMERG "<0>" /* system is unusable */
53 #define SD_ALERT "<1>" /* action must be taken immediately */
54 #define SD_CRIT "<2>" /* critical conditions */
55 #define SD_ERR "<3>" /* error conditions */
56 #define SD_WARNING "<4>" /* warning conditions */
57 #define SD_NOTICE "<5>" /* normal but significant condition */
58 #define SD_INFO "<6>" /* informational */
59 #define SD_DEBUG "<7>" /* debug\-level messages */
65 These prefixes are intended to be used in conjunction with stderr\-based logging as implemented by systemd\&. If a systemd service definition file is configured with
66 \fIStandardError=syslog\fR
68 \fIStandardError=kmsg\fR, these prefixes can be used to encode a log level in lines printed\&. This is similar to the kernel
69 \fBprintk()\fR\-style logging\&. See
71 for more information\&.
73 The log levels are identical to
74 \fBsyslog\fR(3)\*(Aqs log level system\&. To use these prefixes simply prefix every line with one of these strings\&. A line that is not prefixed will be logged at the default log level SD_INFO\&.
76 \fBExample\ \&1.\ \&Hello World\fR
78 A daemon may log with the log level NOTICE by issuing this call:
84 fprintf(stderr, SD_NOTICE "Hello World!\en");
91 These APIs are implemented as a shared library, which can be compiled and linked to with the
92 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
97 \fBsd_listen_fds\fR(3),
101 \fBsd_watchdog_enabled\fR(3),
103 \fBsystemd.service\fR(5),
104 \fBsystemd.socket\fR(5),
106 \fBsd-readahead\fR(3),