Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Level_name options #1785

Open
funtus00 opened this issue Dec 21, 2022 · 1 comment
Open

Level_name options #1785

funtus00 opened this issue Dec 21, 2022 · 1 comment
Labels
Milestone

Comments

@funtus00
Copy link

It would be great to have optional level_name name. For example NLog has feature to make level_name as 1, 3 letters or full name.
Current situation (log strings):

[2022-21-12 10:10:01.718][INFO][127.0.0.1] '6': user login
[2022-21-12 10:10:01.724][WARNING][127.0.0.1] '6': domain gmail.com is forbidden to use or does not exist
[2022-21-12 10:10:01.724][ERROR][127.0.0.1] '6': user email is forbidden to use

If set it level_name as 1 or 3 letters logs can be like this:

[2022-21-12 10:10:01.718][INF][127.0.0.1] '6': user login
[2022-21-12 10:10:01.724][WRN][127.0.0.1] '6': domain gmail.com is forbidden to use or does not exist
[2022-21-12 10:10:01.724][ERR][127.0.0.1] '6': user email is forbidden to use

[2022-21-12 10:10:01.718][I][127.0.0.1] '6': user login
[2022-21-12 10:10:01.724][W][127.0.0.1] '6': domain gmail.com is forbidden to use or does not exist
[2022-21-12 10:10:01.724][E][127.0.0.1] '6': user email is forbidden to use

It helps to read logs.
Idea do make option:
INFO = INF = I
ERROR = ERR = E
WARNING = WRN = W
DEBUG = DBG = D
and so on...

@Seldaek
Copy link
Owner

Seldaek commented Feb 4, 2023

So this would be for LineFormatter only right? Probably could easily be added as an additional option via a setMaxLevelNameLength(1)? Would you like to send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants