nydus-error

The nydus-app crate is a collection of utilities to help creating applications for Nydus Image Service project, which provides: - struct BuildTimeInfo: application build and version information. - fn dump_program_info(): dump program build and version information. - fn setup_logging(): setup logging infrastructure for application.

Support

Platforms: - x86_64 - aarch64

Operating Systems: - Linux

Usage

Add nydus-app as a dependency in Cargo.toml

toml [dependencies] nydus-app = "*"

Then add extern crate nydus-error; to your crate root if needed.

Examples

```rust

[macrouse(crateauthors, crate_version)]

extern crate clap;

use clap::App; use std::io::Result; use nydusapp::{BuildTimeInfo, setuplogging};

fn main() -> Result<()> { let level = cmd.valueof("log-level").unwrap().parse().unwrap(); let (btistring, buildinfo) = BuildTimeInfo::dump(crateversion!()); let cmd = App::new("") .version(btistring.asstr()) .author(crateauthors!()) .get_matches();

setup_logging(None, level)?;
print!("{}", build_info);

Ok(())

} ```

License

This code is licensed under Apache-2.0.