Coverage Report

Created: 2025-06-16 06:50

/rust/registry/src/index.crates.io-6f17d22bba15001f/icu_capi-1.5.1/src/logging.rs
Line
Count
Source (jump to first uncovered line)
1
// This file is part of ICU4X. For terms of use, please see the file
2
// called LICENSE at the top level of the ICU4X source tree
3
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5
0
#[diplomat::bridge]
Unexecuted instantiation: ICU4XLogger_init_simple_logger
Unexecuted instantiation: ICU4XLogger_destroy
6
pub mod ffi {
7
    use alloc::boxed::Box;
8
9
    #[diplomat::opaque]
10
    /// An object allowing control over the logging used
11
    pub struct ICU4XLogger;
12
13
    impl ICU4XLogger {
14
        /// Initialize the logger using `simple_logger`
15
        ///
16
        /// Requires the `simple_logger` Cargo feature.
17
        ///
18
        /// Returns `false` if there was already a logger set.
19
        #[cfg(all(not(target_arch = "wasm32"), feature = "simple_logger"))]
20
0
        pub fn init_simple_logger() -> bool {
21
0
            simple_logger::init().is_ok()
22
0
        }
23
24
        /// Deprecated: since ICU4X 1.4, this now happens automatically if the `log` feature is enabled.
25
        #[cfg(target_arch = "wasm32")]
26
        pub fn init_console_logger() -> bool {
27
            false
28
        }
29
    }
30
}
31
32
// semver?
33
#[no_mangle]
34
#[cfg(target_arch = "wasm32")]
35
pub unsafe extern "C" fn icu4x_init() {}