Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / include / ircd_log.h
1 /* - Internet Relay Chat, include/ircd_log.h
2  *   Copyright (C) 1999 Thomas Helvey
3  *
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)
7  *   any later version.
8  *
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.
13  *
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.
17  *
18  *
19  * $Id$
20  */
21 #ifndef INCLUDED_ircd_log_h
22 #define INCLUDED_ircd_log_h
23
24 struct Client;
25
26 enum LogLevel {
27   L_CRIT,
28   L_ERROR,
29   L_WARNING,
30   L_NOTICE,
31   L_TRACE,
32   L_INFO,
33   L_DEBUG,
34   L_LAST_LEVEL
35 };
36
37 /* WARNING WARNING WARNING -- Order is important; these are
38  * used as indexes into an array of LogDesc structures.
39  */
40 enum LogSys {
41   LS_GLINE,
42   LS_LAST_SYSTEM
43 };
44
45 extern void open_log(const char* process_name);
46 extern void close_log(void);
47 extern void set_log_level(int level);
48 extern int  get_log_level(void);
49 extern void ircd_log(int priority, const char* fmt, ...);
50
51 extern void ircd_log_kill(const struct Client* victim,
52                           const struct Client* killer,
53                           const char*          inpath,
54                           const char*          path);
55
56 extern void log_init(const char *process_name);
57 extern void log_reopen(void);
58 extern void log_close(void);
59
60 extern void log_write(enum LogSys subsys, enum LogLevel severity,
61                       const char *fmt, ...);
62
63 #endif /* INCLUDED_ircd_log_h */