1 /* 2 ** Distributed under the terms of the OpenBeOS License. 3 */ 4 #ifndef _SYSLOG_H_ 5 #define _SYSLOG_H_ 6 7 8 /*** options for openlog() ***/ 9 10 #define LOG_PID (1 << 12) /* log the process (thread/team) ID with each message */ 11 #define LOG_CONS (2 << 12) /* log to the system console on error */ 12 #define LOG_ODELAY (4 << 12) /* delay open until syslog() is called */ 13 #define LOG_NDELAY (8 << 12) /* connect to the syslog daemon immediately */ 14 #define LOG_SERIAL (16 << 12) /* dump to serial output as well (not implemented) */ 15 #define LOG_PERROR (32 << 12) /* dump to stderr as well */ 16 #define LOG_NOWAIT (64 << 12) /* do not wait for child processes */ 17 18 19 /*** facilities ***/ 20 21 #define LOG_KERN (0 << 3) /* messages generated by the kernel */ 22 #define LOG_USER (1 << 3) /* by user processes */ 23 #define LOG_MAIL (2 << 3) 24 #define LOG_DAEMON (3 << 3) 25 #define LOG_AUTH (4 << 3) 26 #define LOG_SYSLOG (5 << 3) 27 #define LOG_LPR (6 << 3) 28 #define LOG_NEWS (7 << 3) 29 #define LOG_UUCP (8 << 3) 30 #define LOG_CRON (9 << 3) 31 #define LOG_AUTHPRIV (10 << 3) 32 33 /* these are for local use: */ 34 #define LOG_LOCAL0 (16 << 3) 35 #define LOG_LOCAL1 (17 << 3) 36 #define LOG_LOCAL2 (18 << 3) 37 #define LOG_LOCAL3 (19 << 3) 38 #define LOG_LOCAL4 (20 << 3) 39 #define LOG_LOCAL5 (21 << 3) 40 #define LOG_LOCAL6 (22 << 3) 41 #define LOG_LOCAL7 (23 << 3) 42 43 44 /*** priorities ***/ 45 46 #define LOG_EMERG 0 /* a panic condition */ 47 #define LOG_PANIC LOG_EMERG 48 #define LOG_ALERT 1 /* a condition that should be corrected immediately */ 49 #define LOG_CRIT 2 /* critical conditions like hard drive errors */ 50 #define LOG_ERR 3 51 #define LOG_WARNING 4 52 #define LOG_NOTICE 5 53 #define LOG_INFO 6 54 #define LOG_DEBUG 7 55 56 /* turns a priority into a mask usable for setlogmask() */ 57 #define LOG_MASK(pri) (1 << (pri)) 58 59 60 #ifdef __cplusplus 61 extern "C" { 62 #endif 63 64 // POSIX calls 65 extern void closelog(void); 66 extern void openlog(const char *ident, int options, int facility); 67 extern int setlogmask(int priorityMask); 68 extern void syslog(int priority, const char *message, ...); 69 70 // Be extensions 71 extern void closelog_team(void); 72 extern void openlog_team(const char *ident, int logopt, int facility); 73 extern void log_team(int priority, const char *message, ...); 74 extern int setlogmask_team(int priorityMask); 75 76 extern void closelog_thread(void); 77 extern void openlog_thread(const char *ident, int logopt, int facility); 78 extern void log_thread(int priority, const char *message, ...); 79 extern int setlogmask_thread(int priorityMask); 80 81 #ifdef __cplusplus 82 } 83 #endif 84 85 #endif /* _SYSLOG_H_ */ 86