1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use {CString, CVoid, Error};
extern {
pub fn indy_set_logger(context: *const CVoid,
enabled: Option<EnabledCB>,
log: Option<LogCB>,
flush: Option<FlushCB>) -> Error;
pub fn indy_set_logger_with_max_lvl(context: *const CVoid,
enabled: Option<EnabledCB>,
log: Option<LogCB>,
flush: Option<FlushCB>,
max_lvl: u32)-> Error;
pub fn indy_set_log_max_lvl(max_lvl: u32) -> Error;
pub fn indy_set_default_logger(pattern: CString) -> Error;
pub fn indy_get_logger(context_p: *mut CVoid,
enabled_cb_p: *mut Option<EnabledCB>,
log_cb_p: *mut Option<LogCB>,
flush_cb_p: *mut Option<FlushCB>) -> Error;
}
pub type EnabledCB = extern fn(context: *const CVoid,
level: u32,
target: CString) -> bool;
pub type LogCB = extern fn(context: *const CVoid,
level: u32,
target: CString,
message: CString,
module_path: CString,
file: CString,
line: u32);
pub type FlushCB = extern fn(context: *const CVoid);