2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
5 /* $OpenBSD: log.h,v 1.8 2002/07/19 15:43:33 markus Exp $ */
10 #pragma ident "%Z%%M% %I% %E% SMI"
17 /* $OpenBSD: log.h,v 1.8 2002/07/19 15:43:33 markus Exp $ */
20 * Author: Tatu Ylonen <ylo@cs.hut.fi>
21 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
24 * As far as I am concerned, the code I have written for this software
25 * can be used freely for any purpose. Any derived versions of this
26 * software must be clearly marked as such, and if the derived work is
27 * incompatible with the protocol description in the RFC file, it must be
28 * called by a name other than "ssh" or "Secure Shell".
31 #include <syslog.h> /* Needed for LOG_AUTHPRIV (if present) */
33 /* Supported syslog facilities and levels. */
35 SYSLOG_FACILITY_DAEMON
,
39 SYSLOG_FACILITY_AUTHPRIV
,
41 SYSLOG_FACILITY_LOCAL0
,
42 SYSLOG_FACILITY_LOCAL1
,
43 SYSLOG_FACILITY_LOCAL2
,
44 SYSLOG_FACILITY_LOCAL3
,
45 SYSLOG_FACILITY_LOCAL4
,
46 SYSLOG_FACILITY_LOCAL5
,
47 SYSLOG_FACILITY_LOCAL6
,
48 SYSLOG_FACILITY_LOCAL7
,
49 SYSLOG_FACILITY_NOT_SET
= -1
62 SYSLOG_LEVEL_NOT_SET
= -1
65 void log_init(char *, LogLevel
, SyslogFacility
, int);
67 SyslogFacility
log_facility_number(char *);
68 LogLevel
log_level_number(char *);
70 void set_log_txt_prefix(const char *);
71 void fatal(const char *, ...) __attribute__((format(printf
, 1, 2)));
72 void error(const char *, ...) __attribute__((format(printf
, 1, 2)));
73 void notice(const char *, ...) __attribute__((format(printf
, 1, 2)));
74 void log(const char *, ...) __attribute__((format(printf
, 1, 2)));
75 void verbose(const char *, ...) __attribute__((format(printf
, 1, 2)));
76 void debug(const char *, ...) __attribute__((format(printf
, 1, 2)));
77 void debug2(const char *, ...) __attribute__((format(printf
, 1, 2)));
78 void debug3(const char *, ...) __attribute__((format(printf
, 1, 2)));
80 void fatal_cleanup(void);
81 void fatal_add_cleanup(void (*) (void *), void *);
82 void fatal_remove_cleanup(void (*) (void *), void *);
83 void fatal_remove_all_cleanups(void);
85 void do_log(LogLevel
, const char *, va_list);