1 /*
2  * Copyright (c) 2024, Meta
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #ifndef ZEPHYR_INCLUDE_POSIX_SYSLOG_H_
7 #define ZEPHYR_INCLUDE_POSIX_SYSLOG_H_
8 
9 #include <stdarg.h>
10 
11 /* option */
12 #define LOG_PID    1
13 #define LOG_CONS   2
14 #define LOG_NDELAY 4
15 #define LOG_ODELAY 8
16 #define LOG_NOWAIT 16
17 #define LOG_PERROR 32
18 
19 /* facility */
20 #define LOG_KERN   0
21 #define LOG_USER   1
22 #define LOG_MAIL   2
23 #define LOG_NEWS   3
24 #define LOG_UUCP   4
25 #define LOG_DAEMON 5
26 #define LOG_AUTH   6
27 #define LOG_CRON   7
28 #define LOG_LPR    8
29 #define LOG_LOCAL0 9
30 #define LOG_LOCAL1 10
31 #define LOG_LOCAL2 11
32 #define LOG_LOCAL3 12
33 #define LOG_LOCAL4 13
34 #define LOG_LOCAL5 14
35 #define LOG_LOCAL6 15
36 #define LOG_LOCAL7 16
37 
38 /* priority */
39 #define LOG_EMERG   0
40 #define LOG_ALERT   1
41 #define LOG_CRIT    2
42 #define LOG_ERR     3
43 #define LOG_WARNING 4
44 #define LOG_NOTICE  5
45 #define LOG_INFO    6
46 #define LOG_DEBUG   7
47 
48 /* generate a valid log mask */
49 #define LOG_MASK(mask) ((mask) & BIT_MASK(LOG_DEBUG + 1))
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 void closelog(void);
56 void openlog(const char *ident, int logopt, int facility);
57 int setlogmask(int maskpri);
58 void syslog(int priority, const char *message, ...);
59 void vsyslog(int priority, const char *format, va_list ap);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /* ZEPHYR_INCLUDE_POSIX_SYSLOG_H_ */
66