cubeb_sys/
log.rs

1// Copyright © 2017-2018 Mozilla Foundation
2//
3// This program is made available under an ISC-style license.  See the
4// accompanying file LICENSE for details.
5
6use std::os::raw::{c_char, c_int, c_void};
7
8cubeb_enum! {
9    pub enum cubeb_log_level {
10        CUBEB_LOG_DISABLED = 0,
11        CUBEB_LOG_NORMAL = 1,
12        CUBEB_LOG_VERBOSE = 2,
13    }
14}
15
16pub type cubeb_log_callback = Option<unsafe extern "C" fn(*const c_char, ...)>;
17
18extern "C" {
19    pub fn cubeb_set_log_callback(
20        log_level: cubeb_log_level,
21        log_callback: cubeb_log_callback,
22    ) -> c_int;
23
24    pub fn cubeb_log_get_callback() -> cubeb_log_callback;
25    pub fn cubeb_log_get_level() -> cubeb_log_level;
26
27    pub fn cubeb_async_log_reset_threads(_: c_void);
28    pub fn cubeb_async_log(msg: *const c_char, ...);
29}