1use std::ffi::{c_char, c_int};
2
3#[repr(C)]
4#[allow(non_camel_case_types)]
5pub enum log_priority {
6 DLOG_UNKNOWN = 0,
7 DLOG_DEFAULT,
8 DLOG_VERBOSE,
9 DLOG_DEBUG,
10 DLOG_INFO,
11 DLOG_WARN,
12 DLOG_ERROR,
13 DLOG_FATAL,
14 DLOG_SILENT,
15 DLOG_PRIO_MAX,
16}
17
18#[repr(C)]
19#[allow(non_camel_case_types)]
20pub enum log_id_t {
21 LOG_ID_INVALID = -1,
22 LOG_ID_MAIN,
23 LOG_ID_RADIO,
24 LOG_ID_SYSTEM,
25 LOG_ID_APPS,
26 LOG_ID_KMSG,
27 LOG_ID_SYSLOG,
28 LOG_ID_MAX,
29}
30
31extern "C" {
32 pub fn dlog_print(prio: log_priority, tag: *const c_char, fmt: *const c_char, ...) -> c_int;
33 pub fn __dlog_critical_print(
34 log_id: log_id_t,
35 prio: c_int,
36 tag: *const c_char,
37 fmt: *const c_char,
38 ...
39 ) -> c_int;
40 pub fn dlog_set_minimum_priority(priority: c_int) -> c_int;
41}