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

Explicitly bind logging procs in templates #168

Merged
merged 2 commits into from
Sep 30, 2023
Merged

Explicitly bind logging procs in templates #168

merged 2 commits into from
Sep 30, 2023

Conversation

metagn
Copy link
Contributor

@metagn metagn commented Sep 29, 2023

The logging templates in logger reference procs like error, info, warn etc. from the logging module. These are implicitly bound, as they have exactly 1 overload in the scope of the template definitions (nim-lang/Nim#11184).

If this behavior of Nim or the context in logger were to change, these would start preferring procs like macros.error instead and cause issues. Explicitly binding them keeps the current behavior consistent.

An alternative would be to directly call logging.error join(args) etc.

The logging templates in `logger` reference procs like `error`, `info`, `warn` etc. from the `logging` module. These are implicitly bound, as they have exactly 1 overload in the scope of the template definitions (nim-lang/Nim#11184).

If this behavior of Nim or the context in `logger` were to change, these would start preferring procs like `macros.error` instead and cause issues. Explicitly binding them keeps the current behavior consistent.

An alternative would be to directly call `logging.error join(args)` etc.
This pull request was closed.
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