mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-03 01:16:14 +03:00
Rename max indentation constant for clarity.
This commit is contained in:
+4
-3
@@ -104,7 +104,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
}
|
||||
|
||||
fn init_logger() {
|
||||
const NSPACES: usize = 40;
|
||||
const MAX_INDENT: usize = 40;
|
||||
|
||||
let format = |record: &log::LogRecord| {
|
||||
if record.level() == log::LogLevel::Trace {
|
||||
// prepend spaces to indent the final string
|
||||
@@ -112,8 +113,8 @@ fn init_logger() {
|
||||
format!("{lvl}:{module}{depth:2}{indent:<indentation$} {text}",
|
||||
lvl = record.level(),
|
||||
module = record.location().module_path(),
|
||||
depth = indentation / NSPACES,
|
||||
indentation = indentation % NSPACES,
|
||||
depth = indentation / MAX_INDENT,
|
||||
indentation = indentation % MAX_INDENT,
|
||||
indent = "",
|
||||
text = record.args())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user