xref: /openbsd-src/usr.bin/cvs/log.h (revision ce7279d89b71439c96c854f612f4ac93a461fdc4)
1*ce7279d8Sjsg /*	$OpenBSD: log.h,v 1.24 2024/05/21 05:00:48 jsg Exp $	*/
26c121f58Sjfb /*
34743a7c5Sjfb  * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
46c121f58Sjfb  * All rights reserved.
56c121f58Sjfb  *
66c121f58Sjfb  * Redistribution and use in source and binary forms, with or without
76c121f58Sjfb  * modification, are permitted provided that the following conditions
86c121f58Sjfb  * are met:
96c121f58Sjfb  *
106c121f58Sjfb  * 1. Redistributions of source code must retain the above copyright
116c121f58Sjfb  *    notice, this list of conditions and the following disclaimer.
126c121f58Sjfb  * 2. The name of the author may not be used to endorse or promote products
136c121f58Sjfb  *    derived from this software without specific prior written permission.
146c121f58Sjfb  *
156c121f58Sjfb  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
166c121f58Sjfb  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
176c121f58Sjfb  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
186c121f58Sjfb  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
196c121f58Sjfb  * EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
206c121f58Sjfb  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
216c121f58Sjfb  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
226c121f58Sjfb  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
236c121f58Sjfb  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
246c121f58Sjfb  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
256c121f58Sjfb  */
266c121f58Sjfb 
276c121f58Sjfb #ifndef LOG_H
286c121f58Sjfb #define LOG_H
296c121f58Sjfb 
301f8531bdSotto #include <stdarg.h>
311f8531bdSotto 
326c121f58Sjfb /* log priority levels */
333ad3fb45Sjoris #define LP_NOTICE	0
343ad3fb45Sjoris #define LP_ERR		1
353ad3fb45Sjoris #define LP_ERRNO	2
363ad3fb45Sjoris #define LP_ABORT	3
373ad3fb45Sjoris #define LP_TRACE	4
38e8755a22Stobias #define LP_RCS		5
396c121f58Sjfb 
40449bca81Sniallo #define LOG_REVSEP \
41449bca81Sniallo "----------------------------"
42449bca81Sniallo 
43449bca81Sniallo #define LOG_REVEND \
44449bca81Sniallo  "============================================================================="
45449bca81Sniallo 
46cc3db800Sxsa void	cvs_log(u_int, const char *, ...) __attribute__((format(printf, 2, 3)));
47cc3db800Sxsa void	cvs_vlog(u_int, const char *, va_list);
485595e4b2Sxsa int	cvs_printf(const char *, ...) __attribute__((format(printf, 1, 2)));
495595e4b2Sxsa void	fatal(const char *, ...) __dead __attribute__((format(printf, 1,2)));
506c121f58Sjfb 
516c121f58Sjfb #endif	/* LOG_H */
52