| 31 | * - Send logs with different types and levels, some should not be displayed. |
| 32 | */ |
| 33 | static int |
| 34 | test_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 | |
| 63 | static int |
| 64 | test_logs(void) |
no test coverage detected