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

[Feature] Add 'TAG' options #11

Open
Lexycon opened this issue Mar 2, 2023 · 1 comment
Open

[Feature] Add 'TAG' options #11

Lexycon opened this issue Mar 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Lexycon
Copy link

Lexycon commented Mar 2, 2023

Is there a chance to add a tag feature to the logger?

There was already a PR on the old repo:
[Feature] Add 'TAG' options #103

And here is a discussion:
simc/logger#68 (comment)

The reason for this is, if you have multiple components for example, I use get_it to inject my logger into these components to collect all log data in one place (FileOutput, whatever.). But I can't figure out which log comes from what component. Maybe just an optional tag attribute like the guy did in the PR.

@Bungeefan Bungeefan added the enhancement New feature or request label Mar 4, 2023
@Bungeefan
Copy link
Member

The original PR is creating rather big breaking API changes, which I would like to avoid for the most part.
However, as there is currently no way in Dart to add optional positional and optional named parameters in the same method signature, this would require at least some breaking changes anyway.

My two cents on the discussion:
It isn't really comparable with Android's Log as this is a static class and after all logger has been created to be usable with multiple instances and possibly a custom PrefixPrinter.
On the other side, an optional TAG parameter could be helpful, this would allow people to tag their logging using a single (possibly static) instance.

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

No branches or pull requests

2 participants