diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-06-01 17:26:16 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-06-01 17:27:16 +0200 |
commit | 213ba152fdf7978773be5b8a72e040584765137f (patch) | |
tree | 3ac3626e097aabbfd7468335b4ce2d2c7d566d47 /src/shared/conf-parser.c | |
parent | 0d9243f022d244632b1ab26cfc8b46794b7fc5d6 (diff) |
journal: allow setting of a cutoff log level for disk storage, syslog, kmsg, console forwarding
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r-- | src/shared/conf-parser.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 724bcf00c9..8c62fb959b 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -876,3 +876,60 @@ int config_parse_mode( *m = (mode_t) l; return 0; } + +int config_parse_facility( + const char *filename, + unsigned line, + const char *section, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + + int *o = data, x; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + x = log_facility_unshifted_from_string(rvalue); + if (x < 0) { + log_error("[%s:%u] Failed to parse log facility, ignoring: %s", filename, line, rvalue); + return 0; + } + + *o = (x << 3) | LOG_PRI(*o); + + return 0; +} + +int config_parse_level( + const char *filename, + unsigned line, + const char *section, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + + int *o = data, x; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + x = log_level_from_string(rvalue); + if (x < 0) { + log_error("[%s:%u] Failed to parse log level, ignoring: %s", filename, line, rvalue); + return 0; + } + + *o = (*o & LOG_FACMASK) | x; + return 0; +} |