ptlog
cargo devel CI / cargo CI (push) Successful in 2m28s
Details
cargo devel CI / cargo CI (push) Successful in 2m28s
Details
This commit is contained in:
parent
70b3a63180
commit
c0b0d16622
|
@ -1692,6 +1692,14 @@ dependencies = [
|
|||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ptlog"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"libpt",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.36"
|
||||
|
|
|
@ -24,9 +24,11 @@ members = [
|
|||
"members/onlytoken",
|
||||
"members/sqlite-demo",
|
||||
"members/diesel-demo",
|
||||
"members/ptlog",
|
||||
]
|
||||
default-members = [
|
||||
".",
|
||||
"members/ptlog",
|
||||
"members/diesel-demo",
|
||||
"members/onlytoken",
|
||||
"members/fluent-demo",
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "ptlog"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
libpt.workspace = true
|
||||
anyhow.workspace = true
|
|
@ -0,0 +1,18 @@
|
|||
use std::any::Any;
|
||||
|
||||
use libpt::log;
|
||||
use log::{debug, error, info, trace, warn};
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let logger = log::Logger::builder()
|
||||
.show_time(false)
|
||||
.max_level(log::Level::TRACE)
|
||||
.build()?;
|
||||
warn!("logger is now enabled");
|
||||
info!("logger was initialized");
|
||||
debug!("logger: {logger:#?}");
|
||||
trace!("Type id of libpt::log::Logger is '{:#?}'", logger.type_id());
|
||||
let u = 19;
|
||||
error!(some_value=u, "No error, this is just a test");
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in New Issue