oslog 0.0.1

A minimal safe wrapper around Apple's unified logging system
docs.rs failed to build oslog-0.0.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

A minimal wrapper around Apple's unified logging system.

By default support for the log crate is provided, but you can disable it using the feature flags if you like:

[dependencies]
oslog = { version = "0.0.1", default-features = false }

Example

fn main() {
    OsLogger::new("com.example.test", "testing")
        .level_filter(LevelFilter::Debug)
        .init()
        .unwrap();

    // Maps to OS_LOG_TYPE_DEBUG
    trace!("Trace");

    // Maps to OS_LOG_TYPE_INFO
    debug!("Debug");

    // Maps to OS_LOG_TYPE_DEFAULT
    info!("Info");

    // Maps to OS_LOG_TYPE_ERROR
    warn!("Warn");

    // Maps to OS_LOG_TYPE_CRITICAL
    error!("Error");
}

Missing features

Almost everything :).

  • Multiple categories, although I'm planning on adding optional support for setting the category to the module name which invoked the log call.
  • Activities
  • Tracing
  • Native support for line numbers and file names.