xref: /openbsd-src/usr.sbin/ldpd/log.h (revision 3e2a4faaf2b47661d59c432f2b5e8d13b43317ca)
1*3e2a4faaSbenno /*	$OpenBSD: log.h,v 1.16 2017/01/20 12:19:18 benno Exp $ */
2ab0c2486Smichele 
3ab0c2486Smichele /*
4ab0c2486Smichele  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
5ab0c2486Smichele  *
6ab0c2486Smichele  * Permission to use, copy, modify, and distribute this software for any
7ab0c2486Smichele  * purpose with or without fee is hereby granted, provided that the above
8ab0c2486Smichele  * copyright notice and this permission notice appear in all copies.
9ab0c2486Smichele  *
10ab0c2486Smichele  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11ab0c2486Smichele  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12ab0c2486Smichele  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13ab0c2486Smichele  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14ab0c2486Smichele  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15ab0c2486Smichele  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16ab0c2486Smichele  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17ab0c2486Smichele  */
18ab0c2486Smichele 
19*3e2a4faaSbenno #ifndef LOG_H
20*3e2a4faaSbenno #define LOG_H
21ab0c2486Smichele 
22ab0c2486Smichele #include <stdarg.h>
23ab0c2486Smichele 
24*3e2a4faaSbenno extern const char	*log_procname;
25a8c39dc0Srenato 
26ab0c2486Smichele void	 log_init(int);
277dc5fe12Sclaudio void	 log_verbose(int);
28a8e25944Sbenno void	 logit(int, const char *, ...)
29a8e25944Sbenno 		__attribute__((__format__ (printf, 2, 3)));
30*3e2a4faaSbenno void	 vlog(int, const char *, va_list)
31*3e2a4faaSbenno 		__attribute__((__format__ (printf, 2, 0)));
32a8e25944Sbenno void	 log_warn(const char *, ...)
33a8e25944Sbenno 		__attribute__((__format__ (printf, 1, 2)));
34a8e25944Sbenno void	 log_warnx(const char *, ...)
35a8e25944Sbenno 		__attribute__((__format__ (printf, 1, 2)));
36a8e25944Sbenno void	 log_info(const char *, ...)
37a8e25944Sbenno 		__attribute__((__format__ (printf, 1, 2)));
38a8e25944Sbenno void	 log_debug(const char *, ...)
39a8e25944Sbenno 		__attribute__((__format__ (printf, 1, 2)));
40a8e25944Sbenno void	 fatal(const char *) __dead
41a8e25944Sbenno 		__attribute__((__format__ (printf, 1, 0)));
42a8e25944Sbenno void	 fatalx(const char *) __dead
43a8e25944Sbenno 		__attribute__((__format__ (printf, 1, 0)));
44a8c39dc0Srenato 
45*3e2a4faaSbenno #endif /* LOG_H */
46