chiark / gitweb /
test: extend test-send to send some weirder data
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Oct 2012 23:08:08 +0000 (01:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Oct 2012 23:18:41 +0000 (01:18 +0200)
src/journal/test-journal-send.c

index 9bf42f9b8db6f057eea460788d9c6ea8079760d0..3e986ed99a4d5b00112a6bf8d0d5fc8a090c9873 100644 (file)
@@ -20,6 +20,8 @@
 ***/
 
 #include <systemd/sd-journal.h>
+#include <stdlib.h>
+#include <unistd.h>
 
 #include "log.h"
 
@@ -57,5 +59,20 @@ int main(int argc, char *argv[]) {
                         "WITH_BINARY=this is a binary value \a",
                         NULL);
 
+        syslog(LOG_NOTICE, "Hello World!");
+
+        sd_journal_print(LOG_NOTICE, "Hello World");
+
+        sd_journal_send("MESSAGE=Hello World!",
+                        "MESSAGE_ID=52fb62f99e2c49d89cfbf9d6de5e3555",
+                        "PRIORITY=5",
+                        "HOME=%s", getenv("HOME"),
+                        "TERM=%s", getenv("TERM"),
+                        "PAGE_SIZE=%li", sysconf(_SC_PAGESIZE),
+                        "N_CPUS=%li", sysconf(_SC_NPROCESSORS_ONLN),
+                        NULL);
+
+        sleep(10);
+
         return 0;
 }