From 4aae3bfacb67c05dd7bf3938f3207ef0a8f6cb58 Mon Sep 17 00:00:00 2001 From: Charles Marsh Date: Sat, 13 Aug 2022 11:39:45 -0400 Subject: [PATCH] Rename timestamped_println --- src/bin/rust_python_linter.rs | 8 ++++---- src/logging.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bin/rust_python_linter.rs b/src/bin/rust_python_linter.rs index 08e7d6e987..7f27415f47 100644 --- a/src/bin/rust_python_linter.rs +++ b/src/bin/rust_python_linter.rs @@ -6,7 +6,7 @@ use ::rust_python_linter::fs::collect_python_files; use ::rust_python_linter::linter::check_path; use ::rust_python_linter::logging::set_up_logging; use ::rust_python_linter::message::Message; -use ::rust_python_linter::timestamped_println; +use ::rust_python_linter::tell_user; use anyhow::Result; use clap::{Parser, ValueHint}; use colored::Colorize; @@ -67,7 +67,7 @@ fn report_once(messages: &[Message]) -> Result<()> { } fn report_continuously(messages: &[Message]) -> Result<()> { - timestamped_println!( + tell_user!( "Found {} error(s). Watching for file changes.", messages.len(), ); @@ -90,7 +90,7 @@ fn main() -> Result<()> { if cli.watch { // Perform an initial run instantly. clearscreen::clear()?; - timestamped_println!("Starting linter in watch mode...\n"); + tell_user!("Starting linter in watch mode...\n"); let messages = run_once(&cli.files, !cli.no_cache)?; report_continuously(&messages)?; @@ -107,7 +107,7 @@ fn main() -> Result<()> { Ok(_) => { // Re-run on all change events. clearscreen::clear()?; - timestamped_println!("File change detected...\n"); + tell_user!("File change detected...\n"); let messages = run_once(&cli.files, !cli.no_cache)?; report_continuously(&messages)?; diff --git a/src/logging.rs b/src/logging.rs index 8940155a8f..15d3183d7e 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -2,7 +2,7 @@ use anyhow::Result; use fern; #[macro_export] -macro_rules! timestamped_println { +macro_rules! tell_user { ($($arg:tt)*) => { println!( "[{}] {}",