zlsrs 0.1.6

Rust 标准库扩展工具集,提供更便捷的使用方式
Documentation
use crate::zfile;

#[cfg(feature = "zlog")]
use crate::zlog;

#[test]
fn test_get_dir() {
    let exe_dir = zfile::get_exe_dir();
    assert!(exe_dir.exists());
    println!("执行文件目录: {}", exe_dir.to_str());

    let work_dir = zfile::get_work_dir();
    assert!(work_dir.exists());
    println!("工作目录: {}", work_dir.to_str());
}

#[test]
#[cfg(feature = "zlog")]
fn test_log() {
    zlog::init(None);

    zlog::debug!("1. The is debug");
    zlog::warn!("1. The is warn");

    zlog::init(zlog::Options {
        level: zlog::Level::DEBUG,
        ..Default::default()
    });

    zlog::debug!("2. The is debug");
    zlog::warn!("2. The is warn");
}