mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-25 23:55:56 +03:00
[GH-ISSUE #1785] Level_name options #754
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#754
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @funtus00 on GitHub (Dec 21, 2022).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1785
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 commented on GitHub (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?