From 29830cbf54072bfed25ab88e1a1423c50b0545bf Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Tue, 19 Jan 2016 11:45:16 +0900 Subject: [PATCH] Print error message if read_queued_entry_from_dev returns RQER_PARSE RQER_PARSE is returned when read log has different format with the current backend's. In current, log format is well converted though the backend is changed. However, to debug easily, this code is remained. Change-Id: Ie0055932065054129d0976a31c74cfb1ffec0d08 Signed-off-by: Kichan Kwon --- src/logger/logger.c | 9 +++++++-- src/logutil/logutil.c | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/logger/logger.c b/src/logger/logger.c index 17421bf..40b2ce1 100755 --- a/src/logger/logger.c +++ b/src/logger/logger.c @@ -263,8 +263,13 @@ static void do_logger(struct log_device *dev) goto next; else if (ret == RQER_EAGAIN) break; - else if (ret == RQER_PARSE - || ret == RQER_EPIPE) // EPIPE is not an error: it signals the cyclic buffer having made a full turn and overwritten previous data + else if (ret == RQER_PARSE) { + printf("Wrong formatted message is written. \n"); + continue; + } + /* EPIPE is not an error: it signals the cyclic buffer + * having made a full turn and overwritten previous data */ + else if(ret == RQER_EPIPE) continue; enqueue(&pdev->queue, entry); diff --git a/src/logutil/logutil.c b/src/logutil/logutil.c index a87bd32..ae041ba 100755 --- a/src/logutil/logutil.c +++ b/src/logutil/logutil.c @@ -197,12 +197,12 @@ static void read_log_lines(struct log_device_t* devices) goto next; else if (ret == RQER_EAGAIN) break; - else if(ret == RQER_PARSE) - { + else if(ret == RQER_PARSE) { printf("Wrong formatted message is written.\n"); continue; } - // EPIPE is not an error: it signals the cyclic buffer having made a full turn and overwritten previous data + /* EPIPE is not an error: it signals the cyclic buffer having + * made a full turn and overwritten previous data */ else if(ret == RQER_EPIPE) continue; -- 2.7.4