All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
_log.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <aerospike/as_log.h>
4 #include <citrusleaf/cf_log_internal.h>
5 
6 /******************************************************************************
7  * as_log.h MACROS
8  *****************************************************************************/
9 
10 #define LOGGER &as->log
11 
12 #define as_err(__ctx, __fmt, ... ) \
13  if ( (__ctx) && (__ctx)->callback && AS_LOG_LEVEL_ERROR <= (__ctx)->level ) {\
14  ((as_log_callback) (__ctx)->callback)(AS_LOG_LEVEL_ERROR, __func__, __FILE__, __LINE__, __fmt, ##__VA_ARGS__);\
15  }
16 
17 #define as_warn(__ctx, __fmt, ... ) \
18  if ( (__ctx) && (__ctx)->callback && AS_LOG_LEVEL_WARN <= (__ctx)->level ) {\
19  ((as_log_callback) (__ctx)->callback)(AS_LOG_LEVEL_WARN, __func__, __FILE__, __LINE__, __fmt, ##__VA_ARGS__);\
20  }
21 
22 #define as_info(__ctx, __fmt, ... ) \
23  if ( (__ctx) && (__ctx)->callback && AS_LOG_LEVEL_INFO <= (__ctx)->level ) {\
24  ((as_log_callback) (__ctx)->callback)(AS_LOG_LEVEL_INFO, __func__, __FILE__, __LINE__, __fmt, ##__VA_ARGS__);\
25  }
26 
27 #define as_debug(__ctx, __fmt, ... ) \
28  if ( (__ctx) && (__ctx)->callback && AS_LOG_LEVEL_DEBUG <= (__ctx)->level ) {\
29  ((as_log_callback) (__ctx)->callback)(AS_LOG_LEVEL_DEBUG, __func__, __FILE__, __LINE__, __fmt, ##__VA_ARGS__);\
30  }
31 
32 #define as_trace(__ctx, __fmt, ... ) \
33  if ( (__ctx) && (__ctx)->callback && AS_LOG_LEVEL_TRACE <= (__ctx)->level ) {\
34  ((as_log_callback) (__ctx)->callback)(AS_LOG_LEVEL_TRACE, __func__, __FILE__, __LINE__, __fmt, ##__VA_ARGS__);\
35  }
36 
37 /******************************************************************************
38  * MACROS
39  *****************************************************************************/
40 
41 #define _log_debug(__fmt, ... ) \
42  cf_debug("@%s[%s:%d] - "__fmt, __func__, __FILE__, __LINE__, ##__VA_ARGS__);
43 
44 #define _log_info(__fmt, ... ) \
45  cf_info("@%s[%s:%d] - "__fmt, __func__, __FILE__, __LINE__, ##__VA_ARGS__);
46 
47 #define _log_warn(__fmt, ... ) \
48  cf_warn("@%s[%s:%d] - "__fmt, __func__, __FILE__, __LINE__, ##__VA_ARGS__);
49 
50 #define _log_error(__fmt, ... ) \
51  cf_error("@%s[%s:%d] - "__fmt, __func__, __FILE__, __LINE__, ##__VA_ARGS__);