libdlog: fix buffer disabling issues 20/191220/1
authorMichal Bloch <m.bloch@samsung.com>
Fri, 12 Oct 2018 14:15:46 +0000 (16:15 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Fri, 12 Oct 2018 14:21:42 +0000 (16:21 +0200)
 - fix reenabling a buffer requiring a log to be
   sent to another already enabled buffer

 - fix one log being able to slip through into a
   disabled buffer if was enabled the previous time

Change-Id: I47af64b8a74da31c24472190f2ab22806d16db26
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/libdlog/log.c

index 582267d..1f3c3ea 100644 (file)
@@ -213,9 +213,6 @@ static int dlog_should_log(log_id_t log_id, int prio, const char *tag)
        if (log_id <= LOG_ID_INVALID || LOG_ID_MAX <= log_id)
                return DLOG_ERROR_INVALID_PARAMETER;
 
-       if (!plog[log_id])
-               return DLOG_ERROR_NOT_PERMITTED;
-
        if (dynamic_config) {
                __dynamic_config_update();
 
@@ -236,6 +233,9 @@ static int dlog_should_log(log_id_t log_id, int prio, const char *tag)
                // LCOV_EXCL_STOP
        }
 
+       if (!plog[log_id])
+               return DLOG_ERROR_NOT_PERMITTED;
+
        return DLOG_ERROR_NONE;
 }