nextcloud-desktop/src/csync_log.h

76 lines
2.1 KiB
C
Raw Normal View History

2008-02-27 20:56:47 +03:00
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
2008-02-27 20:56:47 +03:00
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
2008-02-27 20:56:47 +03:00
*
* This library is distributed in the hope that it will be useful,
2008-02-27 20:56:47 +03:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
2008-02-27 20:56:47 +03:00
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2008-02-27 20:56:47 +03:00
*/
/**
* @file csync_log.h
*
* @brief Logging interface of csync
*
* @defgroup csyncLogInternals csync logging internals
* @ingroup csyncInternalAPI
*
* @{
*/
#ifndef _CSYNC_LOG_H
#define _CSYNC_LOG_H
2008-06-27 20:51:44 +04:00
/* GCC have printf type attribute check. */
#ifndef PRINTF_ATTRIBUTE
2008-06-27 20:51:44 +04:00
#ifdef __GNUC__
2013-07-31 16:50:44 +04:00
#ifdef _WIN32
#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__gnu_printf__, a, b)))
2008-06-27 20:51:44 +04:00
#else
2013-07-31 16:50:44 +04:00
#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
#endif
#else
2008-06-27 20:51:44 +04:00
#define PRINTF_ATTRIBUTE(a,b)
#endif /* __GNUC__ */
#endif /* ndef PRINTF_ATTRIBUTE */
2008-06-27 20:51:44 +04:00
2012-10-27 18:05:16 +04:00
enum csync_log_priority_e {
CSYNC_LOG_PRIORITY_NOLOG = 0,
CSYNC_LOG_PRIORITY_FATAL,
CSYNC_LOG_PRIORITY_ALERT,
CSYNC_LOG_PRIORITY_CRIT,
CSYNC_LOG_PRIORITY_ERROR,
CSYNC_LOG_PRIORITY_WARN,
CSYNC_LOG_PRIORITY_NOTICE,
CSYNC_LOG_PRIORITY_INFO,
CSYNC_LOG_PRIORITY_DEBUG,
CSYNC_LOG_PRIORITY_TRACE,
CSYNC_LOG_PRIORITY_NOTSET,
CSYNC_LOG_PRIORITY_UNKNOWN,
};
2008-02-27 20:56:47 +03:00
#define CSYNC_LOG(priority, ...) \
csync_log(priority, __FUNCTION__, __VA_ARGS__)
2008-02-27 20:56:47 +03:00
void csync_log(int verbosity,
2012-10-27 18:05:16 +04:00
const char *function,
const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
2008-02-27 20:56:47 +03:00
/**
* }@
*/
#endif /* _CSYNC_LOG_H */
2009-05-22 22:23:54 +04:00
2012-10-27 18:05:16 +04:00
/* vim: set ft=c.doxygen ts=4 sw=4 et cindent: */