log4rs icon indicating copy to clipboard operation
log4rs copied to clipboard

is it possible to configure cutting string from left?

Open t1hq opened this issue 3 years ago • 3 comments

for example, if i'm writing log in file src\log\mod.rs, {f:>8.8} will log the following string:

src\log\

it would be more helpful if it is logged as:

og\mod.rs

t1hq avatar Jul 19 '22 03:07 t1hq

I'm sorry but i don't think i have enough context to answer your question. Can you please say more?

estk avatar Jul 19 '22 04:07 estk

short version: i would like to cut the source file message from left instead of right, if the message is too long.

let's say i'm configuring with this pattern:

{f:8.8} - {m}{n}

so if i write log in a file src/log/test.rs like this:

fn test() {
  info!("this is a test");
}

i will get this log: src/log/ - this is a test filename will be cut if the path is too long. i think it is more helpful for me if the message will be cut from right, the log message will be: /test.rs - this is a test

but i couldn't to find a way to configure.

thanks for the reply!

t1hq avatar Jul 19 '22 05:07 t1hq

I understand, I don't believe this is currently possible. If you are interested in implementing this feature I would be happy to help mentor.

estk avatar Jul 19 '22 16:07 estk