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

Add support to optional log message prefix #7

Open
prodis opened this issue May 11, 2021 · 0 comments
Open

Add support to optional log message prefix #7

prodis opened this issue May 11, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@prodis
Copy link
Collaborator

prodis commented May 11, 2021

Commonly a prefix is used in log messages.

For example:

[
  "[",
  inspect(__MODULE__),
  "] My info message."
]
|> Miss.String.build()
|> MetaLogger.info()
# => [MyModule] My info message.

My proposal is to create an overload function for each log level to receive the message prefix:

MetaLogger.info("PREFIX", "My info message")
# => [PREFIX] My info message.

MetaLogger.info(__MODULE__, "My info message")
# => [MyModule] My info message.
@prodis prodis added the enhancement New feature or request label May 11, 2021
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

1 participant