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

Tag field #67

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Tag field #67

wants to merge 2 commits into from

Conversation

pyciko
Copy link

@pyciko pyciko commented Mar 23, 2024

For big projects with many submodules, it is handy to mark the submodule that sent a log message. For example, if you have a realtime project with Teams, Users and Chats, and certain event parsing for some of these instances has failed, you'd probably want to print something like "[TEAMS] Failed fetching new avatar for team 2352379". That way, it's much easier to notice the desired messages.
Basically I'm proposing to add a nullable "tag" field for Logger itself and individual log events (individual tags override Logger tag). This is not done on Printer level because Printer tags can't be individual for each log.
I'm not sure about 2 things:

  1. How to format the tag in SimplePrinter: "[SomeTag]" or "TAG: SomeTag. I like the first variant because it's more compact.
  2. Where to put it in PrettyPrinter. Right now it shows at the top of the message.

@Bungeefan Bungeefan marked this pull request as draft April 12, 2024 22:17
@Bungeefan
Copy link
Member

Thanks for the pull request.
However, since it hasn't even been decided yet whether such a feature will be added, let alone how it will be implemented, I can't really review this PR at this time and marked it as a draft for now. Sorry.

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

Successfully merging this pull request may close these issues.

2 participants