1 /* SPDX-License-Identifier: MIT-0 */
7 #include <systemd/sd-journal.h>
8 #include <systemd/sd-daemon.h>
10 int main(int argc
, char *argv
[]) {
13 fd
= sd_journal_stream_fd("test", LOG_INFO
, 1);
16 fprintf(stderr
, "Failed to create stream fd: %m\n");
19 log
= fdopen(fd
, "w");
21 fprintf(stderr
, "Failed to create file object: %m\n");
25 fprintf(log
, "Hello World!\n");
26 fprintf(log
, SD_WARNING
"This is a warning!\n");