bepass-org / bepass

A simple DPI bypass tool written in go
MIT License
342 stars 71 forks source link

refactor: replace log with slog #36

Closed elecm closed 10 months ago

elecm commented 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)