diff options
Diffstat (limited to 'libbb/logenv.c')
-rw-r--r-- | libbb/logenv.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libbb/logenv.c b/libbb/logenv.c new file mode 100644 index 000000000..66c60bd4e --- /dev/null +++ b/libbb/logenv.c | |||
@@ -0,0 +1,24 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Utility routines. | ||
4 | * | ||
5 | * Copyright (C) 2014 by Fugro Intersite B.V. <m.stam@fugro.nl> | ||
6 | * | ||
7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | ||
8 | */ | ||
9 | #include "libbb.h" | ||
10 | |||
11 | void FAST_FUNC bb_logenv_override(void) | ||
12 | { | ||
13 | const char* mode = getenv("LOGGING"); | ||
14 | |||
15 | if (!mode) | ||
16 | return; | ||
17 | |||
18 | if (strcmp(mode, "none") == 0) | ||
19 | logmode = LOGMODE_NONE; | ||
20 | #if ENABLE_FEATURE_SYSLOG | ||
21 | else if (strcmp(mode, "syslog") == 0) | ||
22 | logmode = LOGMODE_SYSLOG; | ||
23 | #endif | ||
24 | } | ||