hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
cf_log.h
Go to the documentation of this file.
1
/*
2
* Copyright 2012 Aerospike. All rights reserved.
3
*/
4
#pragma once
5
6
#include <stdarg.h>
7
#include "
cf_atomic.h
"
8
9
extern
cf_atomic32
g_log_level
;
10
extern
cf_atomic_p
g_log_callback
;
11
12
#define G_LOG_LEVEL ((int)cf_atomic32_get(g_log_level))
13
#define G_LOG_CB ((cf_log_callback)cf_atomic_p_get(g_log_callback))
14
15
//====================================================================
16
// Public API
17
//
18
22
typedef
enum
{
26
CF_NO_LOGGING
= -1,
27
31
CF_ERROR
,
32
36
CF_WARN
,
37
41
CF_INFO
,
42
46
CF_DEBUG
47
}
cf_log_level
;
48
59
typedef
void (*
cf_log_callback
)(
cf_log_level
level,
const
char
* fmt, ...);
60
70
static
inline
void
cf_set_log_level(
cf_log_level
level)
71
{
72
cf_atomic32_set
(&
g_log_level
, (
cf_atomic32
)level);
73
}
74
86
static
inline
void
cf_set_log_callback(
cf_log_callback
callback)
87
{
88
if
(callback) {
89
cf_atomic_p_set
(&g_log_callback, (
cf_atomic_p
)callback);
90
}
91
}
92
93
static
inline
int
cf_info_enabled()
94
{
95
return
CF_INFO
<=
G_LOG_LEVEL
;
96
}
97
98
static
inline
int
cf_debug_enabled()
99
{
100
return
CF_DEBUG
<=
G_LOG_LEVEL
;
101
}
sources
utils
kvdb
src
citrusleaf
cf_log.h
Generated on Tue Jun 30 2015 19:42:13 for hce-node application by
1.8.1.2