chiark / gitweb /
lookup: always also look into /usr/lib for units
[elogind.git] / src / logger.c
index eb62688f40aeba0d1bed9ed4e009712a17bc9fc5..faa6c9721f2f3752692124c9592f992ce609cba7 100644 (file)
@@ -93,42 +93,6 @@ struct Stream {
         LIST_FIELDS(Stream, stream);
 };
 
-static void parse_priority(char **p, int *priority) {
-        int a = 0, b = 0, c = 0;
-        int k;
-
-        assert(p);
-        assert(*p);
-        assert(priority);
-
-        if ((*p)[0] != '<')
-                return;
-
-        if (!strchr(*p, '>'))
-                return;
-
-        if ((*p)[2] == '>') {
-                c = undecchar((*p)[1]);
-                k = 3;
-        } else if ((*p)[3] == '>') {
-                b = undecchar((*p)[1]);
-                c = undecchar((*p)[2]);
-                k = 4;
-        } else if ((*p)[4] == '>') {
-                a = undecchar((*p)[1]);
-                b = undecchar((*p)[2]);
-                c = undecchar((*p)[3]);
-                k = 5;
-        } else
-                return;
-
-        if (a < 0 || b < 0 || c < 0)
-                return;
-
-        *priority = a*100+b*10+c;
-        *p += k;
-}
-
 static int stream_log(Stream *s, char *p, usec_t ts) {
 
         char header_priority[16], header_time[64], header_pid[16];
@@ -141,7 +105,7 @@ static int stream_log(Stream *s, char *p, usec_t ts) {
         priority = s->priority;
 
         if (s->prefix)
-                parse_priority(&p, &priority);
+                parse_syslog_priority(&p, &priority);
 
         if (*p == 0)
                 return 0;