[Sheepdog] [PATCH] logger: remove printk-style log level check

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Oct 15 05:16:48 CEST 2011


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 lib/logger.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/lib/logger.c b/lib/logger.c
index bd53968..bf053f0 100644
--- a/lib/logger.c
+++ b/lib/logger.c
@@ -198,11 +198,6 @@ static int log_enqueue(int prio, const char *func, int line, const char *fmt,
 
 	vsnprintf(p, MAX_MSG_SIZE - strlen(p), fmt, ap);
 
-	if (p[0] == '<' && p[2] == '>') {
-		prio = atoi(p + 1);
-		memmove(p, p + 3, strlen(p) - 3 + 1);
-	}
-
 	len = strlen(buff) * sizeof(char) + 1;
 
 	/* not enough space on tail : rewind */
@@ -308,16 +303,10 @@ static void dolog(int prio, const char *func, int line, const char *fmt, va_list
 			return;
 		}
 	} else {
-		char *p, q[MAX_MSG_SIZE];
+		char p[MAX_MSG_SIZE];
 
-		p = q;
 		vsnprintf(p, MAX_MSG_SIZE, fmt, ap);
 
-		if (p[0] == '<' && p[2] == '>') {
-			prio = atoi(p + 1);
-			p += 3;
-		}
-
 		if (log_name)
 			fprintf(stderr, "%s: %s(%d) %s", log_name, func, line, p);
 		else
-- 
1.7.6.3




More information about the sheepdog mailing list