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

feat(logger): add service name as context #1287

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

dragosp1011
Copy link
Contributor

Context

  • fixes #

Changes

@github-actions github-actions bot added package: wallet/backend Wallet backend implementations type: source Source changes package: boutique/backend Boutique backend implementations labels Apr 10, 2024
Copy link
Member

@raducristianpopa raducristianpopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating the logger in every class, we can inject it directly with Awilix:

container.register({
    logger: asValue(logger),
    sessionService: asClass(SessionService)
      .singleton()
      .inject(() => ({
        logger: logger.child(SessionService.name)
      })),
 })

This solution works as well, but I think it fits better to have everything loaded by Awilix.

@github-actions github-actions bot added the type: test Improvements or additions to tests label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: boutique/backend Boutique backend implementations package: wallet/backend Wallet backend implementations type: source Source changes type: test Improvements or additions to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants