csync_log.h

Go to the documentation of this file.
00001 /*
00002  * libcsync -- a library to sync a directory with another
00003  *
00004  * Copyright (c) 2006-2012 by Andreas Schneider <asn@cryptomilk.org>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program 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 Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 /**
00022  * @file csync_log.h
00023  *
00024  * @brief Logging interface of csync
00025  *
00026  * @defgroup csyncLogInternals csync logging internals
00027  * @ingroup csyncInternalAPI
00028  *
00029  * @{
00030  */
00031 
00032 #ifndef _CSYNC_LOG_H
00033 #define _CSYNC_LOG_H
00034 
00035 /* GCC have printf type attribute check.  */
00036 #ifdef __GNUC__
00037 #define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
00038 #else
00039 #define PRINTF_ATTRIBUTE(a,b)
00040 #endif /* __GNUC__ */
00041 
00042 enum csync_log_priority_e {
00043     CSYNC_LOG_PRIORITY_NOLOG = 0,
00044     CSYNC_LOG_PRIORITY_FATAL,
00045     CSYNC_LOG_PRIORITY_ALERT,
00046     CSYNC_LOG_PRIORITY_CRIT,
00047     CSYNC_LOG_PRIORITY_ERROR,
00048     CSYNC_LOG_PRIORITY_WARN,
00049     CSYNC_LOG_PRIORITY_NOTICE,
00050     CSYNC_LOG_PRIORITY_INFO,
00051     CSYNC_LOG_PRIORITY_DEBUG,
00052     CSYNC_LOG_PRIORITY_TRACE,
00053     CSYNC_LOG_PRIORITY_NOTSET,
00054     CSYNC_LOG_PRIORITY_UNKNOWN,
00055 };
00056 
00057 #define CSYNC_LOG(priority, ...) \
00058   csync_log(ctx, priority, __FUNCTION__, __VA_ARGS__)
00059 
00060 void csync_log(CSYNC *ctx,
00061                int verbosity,
00062                const char *function,
00063                const char *format, ...) PRINTF_ATTRIBUTE(4, 5);
00064 
00065 /**
00066  * }@
00067  */
00068 #endif /* _CSYNC_LOG_H */
00069 
00070 /* vim: set ft=c.doxygen ts=4 sw=4 et cindent: */

Generated on Mon Aug 18 13:58:05 2014 for doc by  doxygen 1.5.6