mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-27 01:44:13 +03:00
customlog: remove emojis
Emojis are useful at information compression. Here they just repeat the same log level and reduce clarity. Fixes #111
This commit is contained in:
parent
5ce49c01f6
commit
7fa467bb3a
@ -2,16 +2,8 @@
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use console::style;
|
||||
use console::Emoji;
|
||||
use log::{Level, Metadata, Record};
|
||||
|
||||
pub static FOLDER: Emoji = Emoji("\u{1f4c2}", "");
|
||||
pub static WARN: Emoji = Emoji("\u{26a0}\u{fe0f}", ":-)");
|
||||
pub static ERROR: Emoji = Emoji("\u{26d4}", "");
|
||||
pub static INFO: Emoji = Emoji("\u{2139}\u{fe0f}", "");
|
||||
pub static DEBUG: Emoji = Emoji("\u{1f41b}", "");
|
||||
pub static TRACE: Emoji = Emoji("\u{1f50e}", "");
|
||||
|
||||
pub static CUSTOM_LOG: CustomLog = CustomLog {};
|
||||
|
||||
/// Synchronized log bar and status message printing.
|
||||
@ -27,32 +19,27 @@ impl log::Log for CustomLog {
|
||||
fn log(&self, record: &Record) {
|
||||
match record.level() {
|
||||
Level::Trace => eprintln!(
|
||||
"{} {}: {}",
|
||||
TRACE,
|
||||
"{}: {}",
|
||||
style("[DEBUG]").bold().dim(),
|
||||
record.args()
|
||||
),
|
||||
Level::Debug => eprintln!(
|
||||
"{} {}: {}",
|
||||
DEBUG,
|
||||
"{}: {}",
|
||||
style("[DEBUG]").bold().dim(),
|
||||
record.args()
|
||||
),
|
||||
Level::Info => eprintln!(
|
||||
"{} {}: {}",
|
||||
INFO,
|
||||
"{}: {}",
|
||||
style("[INFO]").bold().dim(),
|
||||
record.args()
|
||||
),
|
||||
Level::Warn => eprintln!(
|
||||
"{} {}: {}",
|
||||
WARN,
|
||||
"{}: {}",
|
||||
style("[WARN]").bold().dim(),
|
||||
record.args()
|
||||
),
|
||||
Level::Error => eprintln!(
|
||||
"{} {}: {}",
|
||||
ERROR,
|
||||
"{}: {}",
|
||||
style("[ERR]").bold().dim(),
|
||||
record.args()
|
||||
),
|
||||
|
@ -1,6 +1,5 @@
|
||||
//! Keep track of evaluations
|
||||
use crate::{
|
||||
customlog,
|
||||
formatter::{Formatter, FormatterName},
|
||||
get_path_mtime, Mtime,
|
||||
};
|
||||
@ -87,9 +86,7 @@ impl CacheManifest {
|
||||
let mut f = File::create(manifest_path)?;
|
||||
f.write_all(
|
||||
format!(
|
||||
"# {} DO NOT HAND EDIT THIS FILE {}\n\n{}",
|
||||
customlog::WARN,
|
||||
customlog::WARN,
|
||||
"# DO NOT HAND EDIT THIS FILE\n\n{}",
|
||||
toml::to_string_pretty(&self)?
|
||||
)
|
||||
.as_bytes(),
|
||||
|
Loading…
Reference in New Issue
Block a user