diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-03-24 11:38:08 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-03-24 11:46:52 +0200 |
commit | 84a07a5b77575a981c86b7e9a3e697428d4a94d2 (patch) | |
tree | f3c9d3a89e605fa140748c34544473e9a7556d92 /src/metadata.rs | |
parent | bcc64e41ca47b1578b3d697d02cdff0ca1e0daa3 (diff) | |
download | subplot-84a07a5b77575a981c86b7e9a3e697428d4a94d2.tar.gz |
feat! change logging to use log/env_logger instead of tracing
We don't use async in Subplot, and the mental overhead of learning
tracing and the code overhead to add support for logging custom
values (implementing the Value trait for Subplot internal types) does
not seem worthwhile.
Sponsored-by: author
Diffstat (limited to 'src/metadata.rs')
-rw-r--r-- | src/metadata.rs | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/metadata.rs b/src/metadata.rs index 3bc7268..0248891 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -8,7 +8,7 @@ use std::path::{Path, PathBuf}; use pandoc_ast::{Inline, Map, MetaValue, Pandoc}; -use tracing::{event, instrument, Level}; +use log::trace; /// Metadata of a document, as needed by Subplot. #[derive(Debug)] @@ -31,7 +31,6 @@ pub struct DocumentImpl { impl Metadata { /// Construct a Metadata from a Document, if possible. - #[instrument(level = "trace", skip(doc))] pub fn new<P>(basedir: P, doc: &Pandoc, template: Option<&str>) -> Result<Metadata> where P: AsRef<Path> + Debug, @@ -41,15 +40,7 @@ impl Metadata { let bindings_filenames = get_bindings_filenames(&doc.meta); let bibliographies = get_bibliographies(basedir.as_ref(), &doc.meta); let classes = get_classes(&doc.meta); - event!( - Level::TRACE, - ?title, - ?date, - ?bindings_filenames, - ?bibliographies, - ?classes, - "Loaded basic metadata" - ); + trace!("Loaded basic metadata"); let mut impls = HashMap::new(); @@ -64,11 +55,7 @@ impl Metadata { } } _ => { - event!( - Level::WARN, - value = ?raw_impls, - "Ignoring unknown raw implementation value" - ); + trace!("Ignoring unknown raw implementation value"); } } } @@ -79,7 +66,7 @@ impl Metadata { get_bindings(&bindings_filenames, &mut bindings, template)?; - event!(Level::TRACE, "Loaded all metadata successfully"); + trace!("Loaded all metadata successfully"); Ok(Metadata { title, |