xref: /dpdk/lib/log/log_internal.h (revision 259f6f78094d0fa33ce2ffe298b8df526c535f3b)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2021 Mellanox Technologies, Ltd
3  */
4 
5 #ifndef LOG_INTERNAL_H
6 #define LOG_INTERNAL_H
7 
8 #include <stdbool.h>
9 #include <stdio.h>
10 #include <stdint.h>
11 #include <time.h>
12 
13 #include <rte_compat.h>
14 
15 /*
16  * Initialize the default log stream.
17  */
18 __rte_internal
19 void eal_log_init(const char *id);
20 
21 /*
22  * Save a log option for later.
23  */
24 __rte_internal
25 int eal_log_save_regexp(const char *regexp, uint32_t level);
26 __rte_internal
27 int eal_log_save_pattern(const char *pattern, uint32_t level);
28 
29 __rte_internal
30 int eal_log_syslog(const char *name);
31 
32 __rte_internal
33 int eal_log_journal(const char *opt);
34 
35 /*
36  * Convert log level to string.
37  */
38 __rte_internal
39 const char *eal_log_level2str(uint32_t level);
40 
41 /*
42  * Close the default log stream
43  */
44 __rte_internal
45 void rte_eal_log_cleanup(void);
46 
47 /*
48  * Add timestamp to console logs
49  */
50 __rte_internal
51 int eal_log_timestamp(const char *fmt);
52 
53 /*
54  * Enable or disable color in log messages
55  */
56 __rte_internal
57 int eal_log_color(const char *mode);
58 
59 #endif /* LOG_INTERNAL_H */
60