ptlog
cargo devel CI / cargo CI (push) Successful in 2m28s Details

This commit is contained in:
Christoph J. Scherr 2024-06-26 15:38:25 +02:00
parent 70b3a63180
commit c0b0d16622
4 changed files with 36 additions and 0 deletions

8
Cargo.lock generated
View File

@ -1692,6 +1692,14 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "ptlog"
version = "0.1.0"
dependencies = [
"anyhow",
"libpt",
]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.36" version = "1.0.36"

View File

@ -24,9 +24,11 @@ members = [
"members/onlytoken", "members/onlytoken",
"members/sqlite-demo", "members/sqlite-demo",
"members/diesel-demo", "members/diesel-demo",
"members/ptlog",
] ]
default-members = [ default-members = [
".", ".",
"members/ptlog",
"members/diesel-demo", "members/diesel-demo",
"members/onlytoken", "members/onlytoken",
"members/fluent-demo", "members/fluent-demo",

8
members/ptlog/Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "ptlog"
version = "0.1.0"
edition = "2021"
[dependencies]
libpt.workspace = true
anyhow.workspace = true

18
members/ptlog/src/main.rs Normal file
View File

@ -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(())
}