log.h

00001 /*
00002  * Copyright (C) 2009 1&1 Internet AG
00003  *
00004  * This file is part of sip-router, a free SIP server.
00005  *
00006  * sip-router is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version
00010  *
00011  * sip-router is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License 
00017  * along with this program; if not, write to the Free Software 
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 #ifndef _LOG_H_
00022 #define _LOG_H_
00023 
00024 #include <syslog.h>
00025 
00026 
00027 
00028 
00029 void init_log(char *_prgname, int _use_syslog);
00030 
00031 void set_log_level(int level);
00032 
00033 void destroy_log(void);
00034 
00035 void pdb_log(int priority, char * format, ...);
00036 
00037 #define LEMERG(fmt, args...) pdb_log(LOG_EMERG, fmt, ## args)
00038 #define LALERT(fmt, args...) pdb_log(LOG_ALERT, fmt, ## args)
00039 #define LCRIT(fmt, args...) pdb_log(LOG_CRIT, fmt, ## args)
00040 #define LERR(fmt, args...) pdb_log(LOG_ERR, fmt, ## args)
00041 #define LWARNING(fmt, args...) pdb_log(LOG_WARNING, fmt, ## args)
00042 #define LNOTICE(fmt, args...) pdb_log(LOG_NOTICE, fmt, ## args)
00043 #define LINFO(fmt, args...) pdb_log(LOG_INFO, fmt, ## args)
00044 #define LDEBUG(fmt, args...) pdb_log(LOG_DEBUG, fmt, ## args)
00045 
00046 
00047 
00048 
00049 #endif