remove main function from logger

This commit is contained in:
Chigozirim Igweamaka 2024-05-15 05:00:44 +01:00
parent 6ac1e0ca46
commit eb95c12802

View file

@ -1,7 +1,6 @@
package utils
import (
"context"
"log/slog"
"os"
"path/filepath"
@ -82,17 +81,3 @@ func GetLogger() *slog.Logger {
logger := slog.New(h)
return logger
}
func main() {
h := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
ReplaceAttr: replaceAttr,
})
logger := slog.New(h)
ctx := context.Background()
err := xerrors.New("something happened")
logger.ErrorContext(ctx, "image uploaded", slog.Any("error", err))
}