X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Flogger.h;fp=src%2Flogger.h;h=a65968ec5c8cbf2ebc09127df3f654738486507a;hb=ff03bb9b0a744530e1145fef656644987a10d62d;hp=0000000000000000000000000000000000000000;hpb=56c51e94a620dd91eeb510176b9c970af9a9a372;p=tinc diff --git a/src/logger.h b/src/logger.h new file mode 100644 index 00000000..a65968ec --- /dev/null +++ b/src/logger.h @@ -0,0 +1,47 @@ +/* + logger.h -- logging + + Copyright (C) 2003-2004 Guus Sliepen + + 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. + + $Id$ +*/ + +#ifndef __LOGGER_H__ +#define __LOGGER_H__ + +typedef enum logger_level { + LOGGER_LEVEL_NONE, + LOGGER_LEVEL_NOTICE, + LOGGER_LEVEL_WARNING, + LOGGER_LEVEL_ERROR, + LOGGER_LEVEL_DEBUG, +} logger_level_t; + +typedef enum logger_mode { + LOGGER_MODE_NULL, + LOGGER_MODE_STDERR, + LOGGER_MODE_FILE, + LOGGER_MODE_SYSLOG, +} logger_mode_t; + +extern bool logger_init(const char *, logger_mode_t); +extern bool logger_exit(void); +extern void logger(int, const char *, ...) __attribute__ ((__format__(printf, 2, 3))); + +extern enum logger_level logger_level; + +#endif