/* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef PG_LOGFILE_H_ #define PG_LOGFILE_H_ #include #pragma interface #include #define L_FATAL 0 #define L_ERROS 1 #define L_ERROR 2 #define L_AUDIT 3 #define L_WARN 4 #define L_MESG 5 #define L_NOISE 6 #define L_JUNK 7 #ifdef __cplusplus extern "C" { #endif void log_init(char *program, char *path, char *infix); void log_level(int level); result lputc(int level, char ch); result lputs(int level, char *s); result lprintf(int level, const char *format, ...) __attribute__((format (printf, 2, 3))); result vlprintf(int level, const char *format, va_list args) __attribute__((format (printf, 2, 0))); #ifdef __cplusplus } #endif #define LOGERROR(msg, args...) \ lprintf(L_ERROR, "%s:" msg, __PRETTY_FUNCTION__ , ## args) #define LOGERROS(msg, args...) \ lprintf(L_ERROS, "%s:" msg, __PRETTY_FUNCTION__ , ## args) #define LOGWARNING(msg, args...) \ lprintf(L_WARN, "%s:" msg, __PRETTY_FUNCTION__ , ## args) #define LOGNOTICE(msg, args...) \ lprintf(L_MESG, "%s:" msg, __PRETTY_FUNCTION__ , ## args) #define LOGINFO(msg, args...) \ lprintf(L_NOISE, "%s:" msg, __PRETTY_FUNCTION__ , ## args) #define LOGDEBUG(msg, args...) \ lprintf(L_JUNK, "%s: " msg, __PRETTY_FUNCTION__ , ## args) #define WARNING LOGWARNING #endif /* !PG_LOGFILE_H_ */