1 /* SPDX-License-Identifier: BSD-3-Clause */ 2 3 #ifndef LOG_PRIVATE_H 4 #define LOG_PRIVATE_H 5 6 /* Defined in limits.h on Linux */ 7 #ifndef LINE_MAX 8 #define LINE_MAX 2048 /* _POSIX2_LINE_MAX */ 9 #endif 10 11 #ifdef RTE_EXEC_ENV_WINDOWS 12 static inline bool 13 log_syslog_enabled(void) 14 { 15 return false; 16 } 17 static inline FILE * 18 log_syslog_open(const char *id __rte_unused) 19 { 20 return NULL; 21 } 22 #else 23 bool log_syslog_enabled(void); 24 FILE *log_syslog_open(const char *id); 25 #endif 26 27 #ifdef RTE_EXEC_ENV_LINUX 28 bool log_journal_enabled(void); 29 FILE *log_journal_open(const char *id); 30 #else 31 static inline bool 32 log_journal_enabled(void) 33 { 34 return false; 35 } 36 static inline FILE * 37 log_journal_open(const char *id __rte_unused) 38 { 39 return NULL; 40 } 41 #endif /* !RTE_EXEC_ENV_LINUX */ 42 43 bool log_timestamp_enabled(void); 44 ssize_t log_timestamp(char *tsbuf, size_t tsbuflen); 45 46 __rte_format_printf(2, 0) 47 int log_print_with_timestamp(FILE *f, const char *format, va_list ap); 48 49 bool log_color_enabled(bool is_tty); 50 51 __rte_format_printf(2, 0) 52 int color_print(FILE *f, const char *format, va_list ap); 53 54 __rte_format_printf(2, 0) 55 int color_print_with_timestamp(FILE *f, const char *format, va_list ap); 56 57 #endif /* LOG_PRIVATE_H */ 58