Skip to content

Instantly share code, notes, and snippets.

@grahamking
Created January 31, 2021 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamking/70eebdadb69d297b063fed7403b12e38 to your computer and use it in GitHub Desktop.
Save grahamking/70eebdadb69d297b063fed7403b12e38 to your computer and use it in GitHub Desktop.
struct StdoutLogger {}
impl std::fmt::Display for StdoutLogger {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "I am StdoutLogger")
}
}
fn main() {
let l = StdoutLogger {};
println!("{}", l);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment