Closed elecm closed 10 months ago
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)
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.