1*e16a722aSderaadt /* $OpenBSD: log.h,v 1.6 2021/12/13 18:28:40 deraadt Exp $ */ 28d2ac903Sotto 38d2ac903Sotto /* 48d2ac903Sotto * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> 58d2ac903Sotto * 68d2ac903Sotto * Permission to use, copy, modify, and distribute this software for any 78d2ac903Sotto * purpose with or without fee is hereby granted, provided that the above 88d2ac903Sotto * copyright notice and this permission notice appear in all copies. 98d2ac903Sotto * 108d2ac903Sotto * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 118d2ac903Sotto * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 128d2ac903Sotto * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 138d2ac903Sotto * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 148d2ac903Sotto * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 158d2ac903Sotto * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 168d2ac903Sotto * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 178d2ac903Sotto */ 188d2ac903Sotto 198d2ac903Sotto #ifndef LOG_H 208d2ac903Sotto #define LOG_H 218d2ac903Sotto 228d2ac903Sotto #include <stdarg.h> 238d2ac903Sotto 248d2ac903Sotto #define LOG_TO_STDERR (1<<0) 258d2ac903Sotto #define LOG_TO_SYSLOG (1<<1) 268d2ac903Sotto 278d2ac903Sotto void log_init(int, int, int); 288d2ac903Sotto void log_procinit(const char *); 298d2ac903Sotto void log_setverbose(int); 308d2ac903Sotto int log_getverbose(void); 318d2ac903Sotto void log_warn(const char *, ...) 328d2ac903Sotto __attribute__((__format__ (printf, 1, 2))); 338d2ac903Sotto void log_warnx(const char *, ...) 348d2ac903Sotto __attribute__((__format__ (printf, 1, 2))); 358d2ac903Sotto void log_info(const char *, ...) 368d2ac903Sotto __attribute__((__format__ (printf, 1, 2))); 378d2ac903Sotto void log_debug(const char *, ...) 388d2ac903Sotto __attribute__((__format__ (printf, 1, 2))); 398d2ac903Sotto void logit(int, const char *, ...) 408d2ac903Sotto __attribute__((__format__ (printf, 2, 3))); 418d2ac903Sotto void vlog(int, const char *, va_list) 428d2ac903Sotto __attribute__((__format__ (printf, 2, 0))); 438d2ac903Sotto __dead void fatal(const char *, ...) 448d2ac903Sotto __attribute__((__format__ (printf, 1, 2))); 458d2ac903Sotto __dead void fatalx(const char *, ...) 468d2ac903Sotto __attribute__((__format__ (printf, 1, 2))); 478d2ac903Sotto 488d2ac903Sotto #endif /* LOG_H */ 49