diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /third_party/rust/oslog/README.md | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/oslog/README.md')
-rw-r--r-- | third_party/rust/oslog/README.md | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/third_party/rust/oslog/README.md b/third_party/rust/oslog/README.md new file mode 100644 index 0000000000..b98ee1b5fd --- /dev/null +++ b/third_party/rust/oslog/README.md @@ -0,0 +1,47 @@ +A minimal wrapper around Apple's unified logging system. + +By default support for the [log](https://docs.rs/log) crate is provided, but you +can disable it using the feature flags if you like: + +```toml +[dependencies] +oslog = { version = "0.0.3", default-features = false } +``` + +When making use of targets (`info!(target: "t", "m");`), you should be aware +that a new log is allocated and stored in a map for the lifetime of the program. +I expect log allocations are extremely small, but haven't attempted to verify +it. + +# Example + +```rust +fn main() { + OsLogger::new("com.example.test") + .level_filter(LevelFilter::Debug) + .category_level_filter("Settings", LevelFilter::Trace) + .init() + .unwrap(); + + // Maps to OS_LOG_TYPE_DEBUG + trace!(target: "Settings", "Trace"); + + // Maps to OS_LOG_TYPE_INFO + debug!("Debug"); + + // Maps to OS_LOG_TYPE_DEFAULT + info!(target: "Parsing", "Info"); + + // Maps to OS_LOG_TYPE_ERROR + warn!("Warn"); + + // Maps to OS_LOG_TYPE_FAULT + error!("Error"); +} +``` + +# Missing features + +* Activities +* Tracing +* Native support for line numbers and file names.
\ No newline at end of file |