use a number for the maximum indentation instead of relying on str::len()
This commit is contained in:
parent
f9a5416135
commit
b7df4fdc75
1 changed files with 2 additions and 2 deletions
|
|
@ -44,8 +44,8 @@ fn init_logger() {
|
|||
let format = |record: &log::LogRecord| {
|
||||
// prepend spaces to indent the final string
|
||||
let indentation = log_settings::settings().indentation;
|
||||
let spaces = " | | | | | | | | ";
|
||||
let indentation = &spaces[..std::cmp::min(indentation, spaces.len())];
|
||||
let spaces = " | | | | | | | | |";
|
||||
let indentation = &spaces[..std::cmp::min(indentation, 44)];
|
||||
format!("{}:{}|{} {}", record.level(), record.location().module_path(), indentation, record.args())
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue