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_USER, LS_OPER, LS_RESOLVER, LS_SOCKET,
53 extern void log_debug_init(int usetty);
54 extern void log_init(const char *process_name);
55 extern void log_reopen(void);
56 extern void log_close(void);
58 extern void log_write(enum LogSys subsys, enum LogLevel severity,
59 unsigned int flags, const char *fmt, ...);
60 extern void log_vwrite(enum LogSys subsys, enum LogLevel severity,
61 unsigned int flags, const char *fmt, va_list vl);
63 extern void log_write_kill(const struct Client *victim,
64 const struct Client *killer,
68 #define LOG_NOSYSLOG 0x01
69 #define LOG_NOFILELOG 0x02
70 #define LOG_NOSNOTICE 0x04
72 #define LOG_NOMASK (LOG_NOSYSLOG | LOG_NOFILELOG | LOG_NOSNOTICE)
74 extern char *log_canon(const char *subsys);
76 extern int log_set_file(const char *subsys, const char *filename);
77 extern char *log_get_file(const char *subsys);
79 extern int log_set_facility(const char *subsys, const char *facility);
80 extern char *log_get_facility(const char *subsys);
82 extern int log_set_snomask(const char *subsys, const char *facility);
83 extern char *log_get_snomask(const char *subsys);
85 extern int log_set_level(const char *subsys, const char *level);
86 extern char *log_get_level(const char *subsys);
88 extern int log_set_default(const char *facility);
89 extern char *log_get_default(void);
91 extern void log_feature_unmark(void);
92 extern int log_feature_mark(int flag);
93 extern void log_feature_report(struct Client *to, int flag);
95 #endif /* INCLUDED_ircd_log_h */