summaryrefslogtreecommitdiffstats
path: root/third_party/rust/android_logger/tests/multiple_init.rs
blob: 26f815d521ae921042b8aff39b8341ede93526d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate android_logger;
extern crate log;

#[test]
fn multiple_init() {
    android_logger::init_once(
        android_logger::Config::default().with_max_level(log::LevelFilter::Trace),
    );

    // Second initialization should be silently ignored
    android_logger::init_once(
        android_logger::Config::default().with_max_level(log::LevelFilter::Error),
    );

    assert_eq!(log::max_level(), log::LevelFilter::Trace);
}