#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
impl LogType {
pub const LOG_APP: LogType = LogType(0);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct LogType(pub ::core::ffi::c_uint);
impl LogLevel {
pub const LOG_DEBUG: LogLevel = LogLevel(3);
pub const LOG_INFO: LogLevel = LogLevel(4);
pub const LOG_WARN: LogLevel = LogLevel(5);
pub const LOG_ERROR: LogLevel = LogLevel(6);
pub const LOG_FATAL: LogLevel = LogLevel(7);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct LogLevel(pub ::core::ffi::c_uint);
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
impl PreferStrategy {
pub const UNSET_LOGLEVEL: PreferStrategy = PreferStrategy(0);
pub const PREFER_CLOSE_LOG: PreferStrategy = PreferStrategy(1);
pub const PREFER_OPEN_LOG: PreferStrategy = PreferStrategy(2);
}
#[repr(transparent)]
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PreferStrategy(pub ::core::ffi::c_uint);
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub type LogCallback = ::core::option::Option<
unsafe extern "C" fn(
type_: LogType,
level: LogLevel,
domain: ::core::ffi::c_uint,
tag: *const ::core::ffi::c_char,
msg: *const ::core::ffi::c_char,
),
>;
extern "C" {
pub fn OH_LOG_Print(
type_: LogType,
level: LogLevel,
domain: ::core::ffi::c_uint,
tag: *const ::core::ffi::c_char,
fmt: *const ::core::ffi::c_char,
...
) -> ::core::ffi::c_int;
#[cfg(feature = "api-18")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
pub fn OH_LOG_PrintMsg(
type_: LogType,
level: LogLevel,
domain: ::core::ffi::c_uint,
tag: *const ::core::ffi::c_char,
message: *const ::core::ffi::c_char,
) -> ::core::ffi::c_int;
#[cfg(feature = "api-18")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
pub fn OH_LOG_PrintMsgByLen(
type_: LogType,
level: LogLevel,
domain: ::core::ffi::c_uint,
tag: *const ::core::ffi::c_char,
tagLen: usize,
message: *const ::core::ffi::c_char,
messageLen: usize,
) -> ::core::ffi::c_int;
pub fn OH_LOG_IsLoggable(
domain: ::core::ffi::c_uint,
tag: *const ::core::ffi::c_char,
level: LogLevel,
) -> bool;
#[cfg(feature = "api-11")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
pub fn OH_LOG_SetCallback(callback: LogCallback);
#[cfg(feature = "api-15")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
pub fn OH_LOG_SetMinLogLevel(level: LogLevel);
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
pub fn OH_LOG_SetLogLevel(level: LogLevel, prefer: PreferStrategy);
}