Padding module name
tekjar opened this issue · 5 comments
Padding the module name would require to know all possible module names in advance to compute the maximum length of the module string. This is currently not something log (and therefor simplelog) supports.
But parsing the module path and just logging the module name could be done. I would accept pull requests adding this feature.
Isn't passing padding as user input and overflowing if a module name doesn't fit not an option? User will know what's the maximum module length and set padding accordingly
Isn't passing padding as user input and overflowing if a module name doesn't fit not an option? User will know what's the maximum module length and set padding accordingly
That could also work, I guess, and would be conceptually very similar to the existing thread padding:
- config: https://docs.rs/simplelog/0.10.0/simplelog/struct.ConfigBuilder.html#method.set_thread_padding
- type: https://docs.rs/simplelog/0.10.0/simplelog/enum.ThreadPadding.html
But a ModulePadding type would use the provided usize as an upper bound rather than an amount of spaces.
I would accept a PR for that proposal (or better in addition to shortening the module path) as well.
