chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unit: pull in logger unit only when running in system mode
[elogind.git]
/
src
/
logger.c
diff --git
a/src/logger.c
b/src/logger.c
index 104d7c385b757d5e63e484577f06d3ff16425874..faa6c9721f2f3752692124c9592f992ce609cba7 100644
(file)
--- a/
src/logger.c
+++ b/
src/logger.c
@@
-104,20
+104,16
@@
static int stream_log(Stream *s, char *p, usec_t ts) {
priority = s->priority;
priority = s->priority;
- if (s->prefix &&
- p[0] == '<' &&
- p[1] >= '0' && p[1] <= '7' &&
- p[2] == '>') {
-
- /* Detected priority prefix */
- priority = LOG_MAKEPRI(LOG_FAC(priority), (p[1] - '0'));
-
- p += 3;
- }
+ if (s->prefix)
+ parse_syslog_priority(&p, &priority);
if (*p == 0)
return 0;
if (*p == 0)
return 0;
+ /* Patch in LOG_USER facility if necessary */
+ if ((priority & LOG_FACMASK) == 0)
+ priority = LOG_USER | LOG_PRI(priority);
+
/*
* The format glibc uses to talk to the syslog daemon is:
*
/*
* The format glibc uses to talk to the syslog daemon is:
*
@@
-130,8
+126,7
@@
static int stream_log(Stream *s, char *p, usec_t ts) {
* We extend the latter to include the process name and pid.
*/
* We extend the latter to include the process name and pid.
*/
- snprintf(header_priority, sizeof(header_priority), "<%i>",
- s->target == STREAM_SYSLOG ? priority : LOG_PRI(priority));
+ snprintf(header_priority, sizeof(header_priority), "<%i>", priority);
char_array_0(header_priority);
if (s->target == STREAM_SYSLOG) {
char_array_0(header_priority);
if (s->target == STREAM_SYSLOG) {