File indexing completed on 2025-01-18 09:55:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef DAVIX_LOGGER_HPP
0023 #define DAVIX_LOGGER_HPP
0024
0025 #include <cstdarg>
0026 #include <utils/davix_types.hpp>
0027
0028
0029
0030 namespace Davix{
0031
0032
0033
0034 #define DAVIX_LOG_CRITICAL 1
0035 #define DAVIX_LOG_WARNING 2
0036 #define DAVIX_LOG_VERBOSE 3
0037 #define DAVIX_LOG_DEBUG 4
0038 #define DAVIX_LOG_TRACE 5
0039 #define DAVIX_LOG_ALL 6
0040
0041
0042 #define DAVIX_LOG_FILE (1<<0)
0043 #define DAVIX_LOG_POSIX (1<<1)
0044 #define DAVIX_LOG_XML (1<<2)
0045 #define DAVIX_LOG_SSL (1<<3)
0046 #define DAVIX_LOG_HEADER (1<<4)
0047 #define DAVIX_LOG_BODY (1<<5)
0048 #define DAVIX_LOG_CHAIN (1<<6)
0049 #define DAVIX_LOG_CORE (1<<7)
0050 #define DAVIX_LOG_GRID (1<<8)
0051 #define DAVIX_LOG_SOCKET (1<<9)
0052 #define DAVIX_LOG_LOCKS (1<<10)
0053 #define DAVIX_LOG_HTTP (1<<11)
0054 #define DAVIX_LOG_S3 (1<<12)
0055 #define DAVIX_LOG_SENSITIVE (1<<13)
0056 #define DAVIX_LOG_SCOPE_NEON (1<<29)
0057 #define DAVIX_LOG_SCOPE_ALL (~(0) ^ DAVIX_LOG_BODY)
0058
0059
0060 extern const char* SCOPE_FILE;
0061 extern const char* SCOPE_HTTP;
0062 extern const char* SCOPE_S3;
0063 extern const char* SCOPE_POSIX;
0064 extern const char* SCOPE_XML;
0065 extern const char* SCOPE_SSL;
0066 extern const char* SCOPE_HEADER;
0067 extern const char* SCOPE_BODY;
0068 extern const char* SCOPE_CHAIN;
0069 extern const char* SCOPE_CORE;
0070 extern const char* SCOPE_GRID;
0071 extern const char* SCOPE_SOCKET;
0072 extern const char* SCOPE_LOCKS;
0073 extern const char* SCOPE_SENSITIVE;
0074 extern const char* SCOPE_ALL;
0075
0076
0077
0078 void logStr(int scope, int log_level, const std::string & str);
0079
0080
0081
0082
0083
0084 int getLogLevel();
0085
0086
0087
0088
0089
0090 void setLogLevel(int logLevel);
0091
0092
0093
0094
0095
0096 int getLogScope();
0097
0098
0099
0100
0101
0102
0103 void setLogScope(int mask);
0104
0105
0106
0107
0108 void setLogScope(const std::string & scope);
0109
0110
0111
0112
0113
0114
0115
0116
0117 std::string getScopeName(int scope_mask);
0118
0119 }
0120
0121
0122
0123
0124 DAVIX_C_DECL_BEGIN
0125
0126
0127
0128
0129
0130 extern DAVIX_EXPORT void davix_set_log_level(int log_mask);
0131
0132
0133 extern DAVIX_EXPORT int davix_get_log_level();
0134
0135
0136 extern DAVIX_EXPORT void davix_logger(int log_mask, const char * msg, ...);
0137
0138
0139 extern DAVIX_EXPORT void davix_vlogger(int log_mask, const char* msg, va_list args);
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149 extern DAVIX_EXPORT void davix_set_log_handler( void (*fhandler)(void* userdata, int mgs_level, const char* msg), void* userdata);
0150
0151
0152 DAVIX_C_DECL_END
0153
0154 #endif