]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Use log_setup()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 21 Apr 2024 16:29:43 +0000 (18:29 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 22 Apr 2024 07:42:29 +0000 (09:42 +0200)
Specifically, this will make tests log to the journal if stderr is
connected to the journal. This means we get proper log priorities
and such compared to if we just logged to stderr.

src/shared/tests.c

index 41177f821e6708874731e990adbec87cc25c75be..a0b1472d8981f2e4de34421256c8b7c3aebc59b2 100644 (file)
@@ -116,8 +116,7 @@ bool slow_tests_enabled(void) {
 void test_setup_logging(int level) {
         log_set_assert_return_is_critical(true);
         log_set_max_level(level);
-        log_parse_environment();
-        log_open();
+        log_setup();
 }
 
 int write_tmpfile(char *pattern, const char *contents) {