Expand description
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, aFrom<log::Level>
implementation is added to easily convert fromlog
s log level to HiLogs log level.
§Feature flags
§log
crate interop
log
— AddsFrom
andInto
conversion fromlog
LogLevel to Hilogs log level.
§OpenHarmony API level
This crate by default exposes bindings for API-level 10.
Optionally enable one of the api-*
features to get access to bindings for newer
OpenHarmony versions.
api-10
(enabled by default) — No effect. API-10 bindings can’t be deselected. The feature exists for internal purposes.api-11
— Enables bindings for OpenHarmony API-level 11api-12
— Enables bindings for OpenHarmony API-level 12 (No changes)api-13
— Enables bindings for OpenHarmony API-level 13 (No changes)document-features
— Document available features when building the documentation
Structs§
Functions§
- OH_
LOG_ ⚠IsLoggable - Checks whether logs of the specified service domain, log tag, and log level can be output.
- OH_
LOG_ ⚠Print - Outputs logs.
- OH_
LOG_ ⚠SetCallback api-11
- Set the user-defined log processing function.
Type Aliases§
- LogCallback
api-11
- Defines the function pointer type for the user-defined log processing function.