rust-cli / env_logger

A logging implementation for `log` which is configured via an environment variable.
https://docs.rs/env_logger
Apache License 2.0
797 stars 124 forks source link

Add function() to Record #272

Closed Bot-Kerem closed 9 months ago

Bot-Kerem commented 1 year ago

Example of usage

env_logger::Builder::new()
  .format(|buf, record| {
    writeln!(buf,
      "{}: {}",
      record.function().unwrap_or("<unknown>"),
      record.args()
    )
  }).init():
epage commented 9 months ago

Record is a type from the log crate and we don't have the ability to ad function(). I'd recommend reaching out to the log crate about functionality like this you'd want.