1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! hilog-sys
//!
//! Rust bindings for the `HiLog` logging framework of OpenHarmony.
//! This crate should only be used on OpenHarmony (`target_env = "ohos"`).
//! More information on hilog in native applications is available in the [hilog native guidelines].
//! You can use the [hdc] tools [hilog command-line interface] to query the saved logs.
//!
//! ## Safety
//!
//! When using `OH_LOG_Print` from Rust you **must** ensure that the `fmt` parameter either
//! - Does not contain any `printf` style format specifiers (like `%s`, `%d`) OR
//! - `fmt` is `"${public}s\0"` and the actual string is passed as the following parameter.
//!
//! ## Crate Features
//!
//! * `log`: When the log feature is enabled, a `From<log::Level>` implementation is added
//! to easily convert from `log`s log level to HiLogs log level.
//!
//! [hilog native guidelines]: https://docs.openharmony.cn/pages/v5.0/en/application-dev/dfx/hilog-guidelines-ndk.md
//! [hilog cli tool]: https://docs.openharmony.cn/pages/v5.0/en/application-dev/dfx/hilog.md
//! [hdc]: https://docs.openharmony.cn/pages/v5.0/en/application-dev/dfx/hdc.md
//!
//! ## Feature flags
extern "C"
pub use *;