Debian Codegraph @

deps/libneon/src/davix_logger_c.h

raw
1 /*
2 * This File is part of Davix, The IO library for HTTP based protocols
3 * Copyright (C) 2013 Adrien Devresse <[email protected]>, CERN
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21
22 #ifndef DAVIX_LOGGER_C_H
23 #define DAVIX_LOGGER_C_H
24
25
26 // log level
27 #define DAVIX_LOG_CRITICAL 1
28 #define DAVIX_LOG_WARNING 2
29 #define DAVIX_LOG_VERBOSE 3
30 #define DAVIX_LOG_DEBUG 4
31 #define DAVIX_LOG_TRACE 5
32 #define DAVIX_LOG_ALL 6
33
34 // log scope
35 #define DAVIX_LOG_FILE (1<<0)
36 #define DAVIX_LOG_POSIX (1<<1)
37 #define DAVIX_LOG_XML (1<<2)
38 #define DAVIX_LOG_SSL (1<<3)
39 #define DAVIX_LOG_HEADER (1<<4)
40 #define DAVIX_LOG_BODY (1<<5)
41 #define DAVIX_LOG_CHAIN (1<<6)
42 #define DAVIX_LOG_CORE (1<<7)
43 #define DAVIX_LOG_GRID (1<<8)
44 #define DAVIX_LOG_SOCKET (1<<9)
45 #define DAVIX_LOG_LOCKS (1<<10)
46 #define DAVIX_LOG_HTTP (1<<11)
47 #define DAVIX_LOG_S3 (1<<12)
48 #define DAVIX_LOG_SENSITIVE (1<<13)
49 #define DAVIX_LOG_SCOPE_NEON (1<<29)
50 #define DAVIX_LOG_SCOPE_ALL (~(0) ^ DAVIX_LOG_BODY)
51
52 /* set the davix log mask */
53 /* everything that is not covered by the mask is dropped */
54 void davix_set_log_level(int log_mask);
55
56 /* get current log mask */
57 int davix_get_log_level();
58
59
60 void davix_vlogger2(int log_mask, int log_level, const char* msg, va_list args);
61
62
63 int davix_get_log_scope();
64
65 /* @brief setup a log handler
66
67 redirect the davix log output to the function f_handler
68 setting up a log handler disable the std output log
69
70 @param fhandler : log handler callback
71 @param userdata : callback userdata */
72 void davix_set_log_handler( void (*fhandler)(void* userdata, int mgs_level, const char* msg), void* userdata);
73
74 #endif /* DAVIX_LOGGER_C_H */