Skip to content

refactor: replace log with slog#36

Merged
DanielcoderX merged 1 commit intobepass-org:mainfrom
elecm:develop
Aug 31, 2023
Merged

refactor: replace log with slog#36
DanielcoderX merged 1 commit intobepass-org:mainfrom
elecm:develop

Conversation

@elecm
Copy link
Copy Markdown
Contributor

@elecm elecm commented Aug 30, 2023

Passing the logger throughout the code is not a good idea and it turns your code into spaghetti code.

Now, Logger is a standalone package that works globally. You can use it like the slog package by importing it into any package.

And the new logger package is a wrapper around slog, and the exported functions are the same as before, so there are minimal code changes.

import "bepass/logger"

logger.Error(msg, args)
logger.Errorf(format, args)

Rewrited the logger package and changed all of its references throughout the code.
Copy link
Copy Markdown
Contributor

@DanielcoderX DanielcoderX left a comment

Choose a reason for hiding this comment

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

Alright, Thanks.

@DanielcoderX DanielcoderX merged commit 9f2378c into bepass-org:main Aug 31, 2023
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