ohos_hilog_sys/
lib.rs

1// Copyright 2024 The ohos_hilog_sys Developers
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7
8use std::os::raw;
9
10#[allow(non_camel_case_types)]
11pub type c_int = raw::c_int;
12#[allow(non_camel_case_types)]
13pub type c_uint = raw::c_uint;
14#[allow(non_camel_case_types)]
15pub type c_char = raw::c_char;
16
17/* automatically generated by rust-bindgen 0.69.2 */
18
19pub const LOG_DOMAIN: u32 = 0;
20
21#[derive(Clone, Copy)]
22#[repr(isize)]
23pub enum LogType {
24    #[allow(non_camel_case_types)]
25    LOG_APP = 0
26}
27
28#[derive(Clone, Copy)]
29#[repr(isize)]
30pub enum LogLevel {
31    DEBUG = 3,
32    INFO = 4,
33    WARN = 5,
34    ERROR = 6,
35    FATAL = 7,
36}
37
38#[link(name = "hilog_ndk.z")]
39extern "C" {
40    pub fn OH_LOG_Print(
41        type_: LogType,
42        level: LogLevel,
43        domain: c_uint,
44        tag: *const c_char,
45        fmt: *const c_char,
46        ...
47    ) -> c_int;
48    pub fn OH_LOG_IsLoggable(
49        domain: c_uint,
50        tag: *const c_char,
51        level: LogLevel,
52    ) -> bool;
53}