* Generates a log message The message will be sent in the stream * defined by the previous call to rte_openlog_stream(). */
| 487 | * defined by the previous call to rte_openlog_stream(). |
| 488 | */ |
| 489 | int |
| 490 | rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap) |
| 491 | { |
| 492 | FILE *f = rte_log_get_stream(); |
| 493 | int ret; |
| 494 | |
| 495 | if (logtype >= rte_logs.dynamic_types_len) |
| 496 | return -1; |
| 497 | if (!rte_log_can_log(logtype, level)) |
| 498 | return 0; |
| 499 | |
| 500 | /* save loglevel and logtype in a global per-lcore variable */ |
| 501 | RTE_PER_LCORE(log_cur_msg).loglevel = level; |
| 502 | RTE_PER_LCORE(log_cur_msg).logtype = logtype; |
| 503 | |
| 504 | ret = vfprintf(f, format, ap); |
| 505 | fflush(f); |
| 506 | return ret; |
| 507 | } |
| 508 | |
| 509 | /* |
| 510 | * Generates a log message The message will be sent in the stream |
no test coverage detected