MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_legacy_logs

Function test_legacy_logs

dpdk/app/test/test_logs.c:33–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 * - Send logs with different types and levels, some should not be displayed.
32 */
33static int
34test_legacy_logs(void)
35{
36 printf("== static log types\n");
37
38 /* set logtype level low to so we can test global level */
39 rte_log_set_level(RTE_LOGTYPE_TESTAPP1, RTE_LOG_DEBUG);
40 rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_DEBUG);
41
42 /* log in error level */
43 rte_log_set_global_level(RTE_LOG_ERR);
44 RTE_LOG(ERR, TESTAPP1, "error message\n");
45 RTE_LOG(CRIT, TESTAPP1, "critical message\n");
46
47 /* log in critical level */
48 rte_log_set_global_level(RTE_LOG_CRIT);
49 RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n");
50 RTE_LOG(CRIT, TESTAPP2, "critical message\n");
51
52 /* bump up single log type level above global to test it */
53 rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_EMERG);
54
55 /* log in error level */
56 rte_log_set_global_level(RTE_LOG_ERR);
57 RTE_LOG(ERR, TESTAPP1, "error message\n");
58 RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n");
59
60 return 0;
61}
62
63static int
64test_logs(void)

Callers 1

test_logsFunction · 0.85

Calls 3

rte_log_set_levelFunction · 0.85
rte_log_set_global_levelFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected