diff mbox series

test/logs: fix dynamic log levels testing

Message ID 1506019449-18782-1-git-send-email-radoslaw.biernacki@linaro.org
State Accepted
Commit e25da5a0a32ea20f6fdb9195e2f2d66500b81c0f
Headers show
Series test/logs: fix dynamic log levels testing | expand

Commit Message

Radoslaw Biernacki Sept. 21, 2017, 6:44 p.m. UTC
This patch fixes the dynamic log levels testing in logs_autotest.
Introduction of rte_log_set_level() in patch c1b5fa94a46f was done
with parameter RTE_LOG_EMERG which caused all RTE_LOG() calls an
early return due to all given levels were far below EMERG.
If first two logs supposed to show up on console, the initial log
level must be low (DEBUG). It is than changed above ERR when we test
if TESTAPP2 log type can be filtered by log type log level.

Fixes: c1b5fa94a46f ("eal: support dynamic log types")

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>

---
 test/test/test_logs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
2.7.4

Comments

Olivier Matz Sept. 25, 2017, 10:25 a.m. UTC | #1
On Thu, Sep 21, 2017 at 08:44:09PM +0200, Radoslaw Biernacki wrote:
> This patch fixes the dynamic log levels testing in logs_autotest.

> Introduction of rte_log_set_level() in patch c1b5fa94a46f was done

> with parameter RTE_LOG_EMERG which caused all RTE_LOG() calls an

> early return due to all given levels were far below EMERG.

> If first two logs supposed to show up on console, the initial log

> level must be low (DEBUG). It is than changed above ERR when we test

> if TESTAPP2 log type can be filtered by log type log level.

> 

> Fixes: c1b5fa94a46f ("eal: support dynamic log types")

> 

> Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>


Acked-by: Olivier Matz <olivier.matz@6wind.com>
Thomas Monjalon Oct. 5, 2017, 9:19 p.m. UTC | #2
25/09/2017 12:25, Olivier MATZ:
> On Thu, Sep 21, 2017 at 08:44:09PM +0200, Radoslaw Biernacki wrote:

> > This patch fixes the dynamic log levels testing in logs_autotest.

> > Introduction of rte_log_set_level() in patch c1b5fa94a46f was done

> > with parameter RTE_LOG_EMERG which caused all RTE_LOG() calls an

> > early return due to all given levels were far below EMERG.

> > If first two logs supposed to show up on console, the initial log

> > level must be low (DEBUG). It is than changed above ERR when we test

> > if TESTAPP2 log type can be filtered by log type log level.

> > 

> > Fixes: c1b5fa94a46f ("eal: support dynamic log types")

> > 

> > Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>

> 

> Acked-by: Olivier Matz <olivier.matz@6wind.com>


Applied, thanks
diff mbox series

Patch

diff --git a/test/test/test_logs.c b/test/test/test_logs.c
index 730a86b..2a77064 100644
--- a/test/test/test_logs.c
+++ b/test/test/test_logs.c
@@ -61,9 +61,9 @@ 
 static int
 test_logs(void)
 {
-	/* enable these logs type */
-	rte_log_set_level(RTE_LOGTYPE_TESTAPP1, RTE_LOG_EMERG);
-	rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_EMERG);
+	/* set logtype level low to so we can test global level */
+	rte_log_set_level(RTE_LOGTYPE_TESTAPP1, RTE_LOG_DEBUG);
+	rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_DEBUG);
 
 	/* log in error level */
 	rte_log_set_global_level(RTE_LOG_ERR);
@@ -75,8 +75,8 @@  test_logs(void)
 	RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n");
 	RTE_LOG(CRIT, TESTAPP2, "critical message\n");
 
-	/* disable one log type */
-	rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_DEBUG);
+	/* bump up single log type level above global to test it */
+	rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_EMERG);
 
 	/* log in error level */
 	rte_log_set_global_level(RTE_LOG_ERR);