1 /* - Internet Relay Chat, include/ircd_log.h
2 * Copyright (C) 1999 Thomas Helvey
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 1, or (at your option)
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef INCLUDED_ircd_log_h
22 #define INCLUDED_ircd_log_h
24 #ifndef INCLUDED_stdarg_h
25 #include <stdarg.h> /* va_list */
26 #define INCLUDED_stdarg_h
31 /* WARNING WARNING WARNING -- Order is important; these enums are
32 * used as indexes into arrays.
47 LS_SYSTEM, LS_CONFIG, LS_OPERMODE, LS_GLINE, LS_JUPE, LS_WHO, LS_NETWORK,
48 LS_OPERKILL, LS_SERVKILL, LS_OPER, LS_OPERLOG, LS_USERLOG, LS_RESOLVER,
49 LS_SOCKET, LS_DEBUG, LS_OLDLOG,
53 extern void open_log(const char* process_name);
54 extern void close_log(void);
55 extern void set_log_level(int level);
56 extern int get_log_level(void);
57 extern void ircd_log(int priority, const char* fmt, ...);
59 extern void ircd_log_kill(const struct Client* victim,
60 const struct Client* killer,
64 extern void log_debug_init(char *file);
65 extern void log_init(const char *process_name);
66 extern void log_reopen(void);
67 extern void log_close(void);
69 extern void log_write(enum LogSys subsys, enum LogLevel severity,
70 unsigned int flags, const char *fmt, ...);
71 extern void log_vwrite(enum LogSys subsys, enum LogLevel severity,
72 unsigned int flags, const char *fmt, va_list vl);
74 extern void log_write_kill(const struct Client *victim,
75 const struct Client *killer,
79 #define LOG_NOSYSLOG 0x01
80 #define LOG_NOFILELOG 0x02
81 #define LOG_NOSNOTICE 0x04
83 #define LOG_NOMASK (LOG_NOSYSLOG | LOG_NOFILELOG | LOG_NOSNOTICE)
85 extern char *log_canon(const char *subsys);
87 extern int log_set_file(const char *subsys, const char *filename);
88 extern char *log_get_file(const char *subsys);
90 extern int log_set_facility(const char *subsys, const char *facility);
91 extern char *log_get_facility(const char *subsys);
93 extern int log_set_snomask(const char *subsys, const char *facility);
94 extern char *log_get_snomask(const char *subsys);
96 extern int log_set_level(const char *subsys, const char *level);
97 extern char *log_get_level(const char *subsys);
99 extern int log_set_default(const char *facility);
100 extern char *log_get_default(void);
102 extern void log_feature_report(struct Client *to);
104 #endif /* INCLUDED_ircd_log_h */