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)]
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
use console::style;
|
use console::style;
|
||||||
use console::Emoji;
|
|
||||||
use log::{Level, Metadata, Record};
|
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 {};
|
pub static CUSTOM_LOG: CustomLog = CustomLog {};
|
||||||
|
|
||||||
/// Synchronized log bar and status message printing.
|
/// Synchronized log bar and status message printing.
|
||||||
@ -27,32 +19,27 @@ impl log::Log for CustomLog {
|
|||||||
fn log(&self, record: &Record) {
|
fn log(&self, record: &Record) {
|
||||||
match record.level() {
|
match record.level() {
|
||||||
Level::Trace => eprintln!(
|
Level::Trace => eprintln!(
|
||||||
"{} {}: {}",
|
"{}: {}",
|
||||||
TRACE,
|
|
||||||
style("[DEBUG]").bold().dim(),
|
style("[DEBUG]").bold().dim(),
|
||||||
record.args()
|
record.args()
|
||||||
),
|
),
|
||||||
Level::Debug => eprintln!(
|
Level::Debug => eprintln!(
|
||||||
"{} {}: {}",
|
"{}: {}",
|
||||||
DEBUG,
|
|
||||||
style("[DEBUG]").bold().dim(),
|
style("[DEBUG]").bold().dim(),
|
||||||
record.args()
|
record.args()
|
||||||
),
|
),
|
||||||
Level::Info => eprintln!(
|
Level::Info => eprintln!(
|
||||||
"{} {}: {}",
|
"{}: {}",
|
||||||
INFO,
|
|
||||||
style("[INFO]").bold().dim(),
|
style("[INFO]").bold().dim(),
|
||||||
record.args()
|
record.args()
|
||||||
),
|
),
|
||||||
Level::Warn => eprintln!(
|
Level::Warn => eprintln!(
|
||||||
"{} {}: {}",
|
"{}: {}",
|
||||||
WARN,
|
|
||||||
style("[WARN]").bold().dim(),
|
style("[WARN]").bold().dim(),
|
||||||
record.args()
|
record.args()
|
||||||
),
|
),
|
||||||
Level::Error => eprintln!(
|
Level::Error => eprintln!(
|
||||||
"{} {}: {}",
|
"{}: {}",
|
||||||
ERROR,
|
|
||||||
style("[ERR]").bold().dim(),
|
style("[ERR]").bold().dim(),
|
||||||
record.args()
|
record.args()
|
||||||
),
|
),
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
//! Keep track of evaluations
|
//! Keep track of evaluations
|
||||||
use crate::{
|
use crate::{
|
||||||
customlog,
|
|
||||||
formatter::{Formatter, FormatterName},
|
formatter::{Formatter, FormatterName},
|
||||||
get_path_mtime, Mtime,
|
get_path_mtime, Mtime,
|
||||||
};
|
};
|
||||||
@ -87,9 +86,7 @@ impl CacheManifest {
|
|||||||
let mut f = File::create(manifest_path)?;
|
let mut f = File::create(manifest_path)?;
|
||||||
f.write_all(
|
f.write_all(
|
||||||
format!(
|
format!(
|
||||||
"# {} DO NOT HAND EDIT THIS FILE {}\n\n{}",
|
"# DO NOT HAND EDIT THIS FILE\n\n{}",
|
||||||
customlog::WARN,
|
|
||||||
customlog::WARN,
|
|
||||||
toml::to_string_pretty(&self)?
|
toml::to_string_pretty(&self)?
|
||||||
)
|
)
|
||||||
.as_bytes(),
|
.as_bytes(),
|
||||||
|
Loading…
Reference in New Issue
Block a user