root/cserver/wlog.h

Revision 1203, 1.9 kB (checked in by efphe, 1 year ago)

moving code from fenilot.org

Line 
1 /*
2  * Note:
3  *  This file is stolen from openssh.
4  *  I needed to hack it a little bit.
5  *
6  *      Federico Tomassini AKA efphe (effetom AT gmail DOT com)
7  */
8
9 /*      $OpenBSD: log.h,v 1.11 2004/06/21 22:02:58 djm Exp $    */
10
11 /*
12  * Author: Tatu Ylonen <ylo@cs.hut.fi>
13  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
14  *                    All rights reserved
15  *
16  * As far as I am concerned, the code I have written for this software
17  * can be used freely for any purpose.  Any derived versions of this
18  * software must be clearly marked as such, and if the derived work is
19  * incompatible with the protocol description in the RFC file, it must be
20  * called by a name other than "ssh" or "Secure Shell".
21  */
22
23 #ifndef WLOG_H
24 #define WLOG_H
25
26 #include <syslog.h> /* Needed for LOG_AUTHPRIV (if present) */
27 #include <stdarg.h>
28 #include <string.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <unistd.h>
32 #include <sys/types.h>
33 #include <signal.h>
34
35
36 /* Supported syslog facilities and levels. */
37 typedef enum {
38         SYSLOG_FACILITY_DAEMON,
39         SYSLOG_FACILITY_USER,
40         SYSLOG_FACILITY_AUTH,
41 #ifdef LOG_AUTHPRIV
42         SYSLOG_FACILITY_AUTHPRIV,
43 #endif
44         SYSLOG_FACILITY_LOCAL0,
45         SYSLOG_FACILITY_LOCAL1,
46         SYSLOG_FACILITY_LOCAL2,
47         SYSLOG_FACILITY_LOCAL3,
48         SYSLOG_FACILITY_LOCAL4,
49         SYSLOG_FACILITY_LOCAL5,
50         SYSLOG_FACILITY_LOCAL6,
51         SYSLOG_FACILITY_LOCAL7,
52         SYSLOG_FACILITY_NOT_SET = -1
53 }       SyslogFacility;
54
55 typedef enum {
56         SYSLOG_LEVEL_QUIET,
57         SYSLOG_LEVEL_FATAL,
58         SYSLOG_LEVEL_ERROR,
59         SYSLOG_LEVEL_INFO,
60         SYSLOG_LEVEL_VERBOSE,
61         SYSLOG_LEVEL_DEBUG1,
62         SYSLOG_LEVEL_DEBUG2,
63         SYSLOG_LEVEL_DEBUG3,
64         SYSLOG_LEVEL_NOT_SET = -1
65 }       LogLevel;
66
67 void     log_init(char *, LogLevel, SyslogFacility, int);
68
69 void     fatal(const char *, ...);
70 void     error(const char *, ...);
71 void     logit(const char *, ...);
72 void     verbose(const char *, ...);
73 void     debug(const char *, ...);
74 void     debug2(const char *, ...);
75 void     debug3(const char *, ...);
76
77 void     do_log(LogLevel, const char *, va_list);
78 #endif
Note: See TracBrowser for help on using the browser.