Skip to content

Commit aa976d8

Browse files
committed
tree-wide: Use log_setup() everywhere
Otherwise the default log target is the console and we won't use the journal socket even if it is available.
1 parent d74ebb1 commit aa976d8

File tree

38 files changed

+43
-99
lines changed

38 files changed

+43
-99
lines changed

src/ac-power/ac-power.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ static int run(int argc, char *argv[]) {
8383
/* This is mostly intended to be used for scripts which want
8484
* to detect whether AC power is plugged in or not. */
8585

86-
log_parse_environment();
87-
log_open();
86+
log_setup();
8887

8988
r = parse_argv(argc, argv);
9089
if (r <= 0)

src/ask-password/ask-password.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ static int run(int argc, char *argv[]) {
226226
usec_t timeout;
227227
int r;
228228

229-
log_show_color(true);
230-
log_parse_environment();
231-
log_open();
229+
log_setup();
232230

233231
r = parse_argv(argc, argv);
234232
if (r <= 0)

src/boot/bless-boot.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,7 @@ static int run(int argc, char *argv[]) {
499499

500500
int r;
501501

502-
log_parse_environment();
503-
log_open();
502+
log_setup();
504503

505504
r = parse_argv(argc, argv);
506505
if (r <= 0)

src/boot/boot-check-no-failures.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ static int run(int argc, char *argv[]) {
7979
uint32_t n;
8080
int r;
8181

82-
log_parse_environment();
83-
log_open();
82+
log_setup();
8483

8584
r = parse_argv(argc, argv);
8685
if (r <= 0)

src/boot/measure.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,9 +1160,7 @@ static int measure_main(int argc, char *argv[]) {
11601160
static int run(int argc, char *argv[]) {
11611161
int r;
11621162

1163-
log_show_color(true);
1164-
log_parse_environment();
1165-
log_open();
1163+
log_setup();
11661164

11671165
r = parse_argv(argc, argv);
11681166
if (r <= 0)

src/cryptenroll/cryptenroll.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,7 @@ static int run(int argc, char *argv[]) {
797797
size_t vks;
798798
int slot, slot_to_wipe, r;
799799

800-
log_show_color(true);
801-
log_parse_environment();
802-
log_open();
800+
log_setup();
803801

804802
r = parse_argv(argc, argv);
805803
if (r <= 0)

src/environment-d-generator/environment-d-generator.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ static int load_and_print(void) {
8484
static int run(int argc, char *argv[]) {
8585
int r;
8686

87-
log_parse_environment();
88-
log_open();
87+
log_setup();
8988

9089
if (argc > 1)
9190
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "This program takes no arguments.");

src/fuzz/fuzz.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ static inline void fuzz_setup_logging(void) {
3333
* in a fuzzing mode, so disable most of the logging. */
3434
log_set_assert_return_is_critical(true);
3535
log_set_max_level(LOG_CRIT);
36-
log_parse_environment();
37-
log_open();
36+
log_setup();
3837
}
3938

4039
/* Force value to not be optimized away. */

src/hwdb/hwdb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ static int hwdb_main(int argc, char *argv[]) {
120120
static int run(int argc, char *argv[]) {
121121
int r;
122122

123-
log_parse_environment();
124-
log_open();
123+
log_setup();
125124

126125
r = parse_argv(argc, argv);
127126
if (r <= 0)

src/journal-remote/journal-remote-main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,7 @@ static int run(int argc, char **argv) {
10701070
_cleanup_free_ char *cert = NULL, *trust = NULL;
10711071
int r;
10721072

1073-
log_show_color(true);
1074-
log_parse_environment();
1073+
log_setup();
10751074

10761075
/* The journal merging logic potentially needs a lot of fds. */
10771076
(void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);

0 commit comments

Comments
 (0)