feat: implement logger #74
Reference in New Issue
Block a user
Delete Branch "logger"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I implemented global logger and generated logs in handlers and services business logic with AI. some of them could contain more information, but that's basic logging system proposition for now.
Okay, I won't be going over the exact instances of where logger is used, that's a big TODO. Otherwise, looks good (with these 2 comments)
@@ -6,2 +6,4 @@"git.ma-al.com/goc_daniel/b2b/app/config""git.ma-al.com/goc_daniel/b2b/app/delivery/web"logger "git.ma-al.com/goc_daniel/b2b/app/internal/logger"I feel like it belongs to utils.
@@ -85,6 +85,8 @@ type AppConfig struct {Version string `env:"APP_VERSION,1.0.0"`Environment string `env:"APP_ENVIRONMENT,development"`BaseURL string `env:"APP_BASE_URL,http://localhost:5173"`LogLevel string `env:"LOG_LEVEL,warn"`Possibly it's own config, but no need to in my opinion
@@ -76,2 +76,4 @@response, rawRefreshToken, err := h.authService.Login(&req)if err != nil {logger.Error("login failed",this is bad. Errors can vary here, from database error to wrong credentials, and I don't think levelError is appropriate. This logger will have to be pushed down to service level.
@@ -0,0 +39,4 @@case slog.LevelWarn:color = yellowcase slog.LevelInfo:color = greenmaybe blue? Like road signs. Probably deep blue. Should definitely be more contrasting with terminal background than LevelDebug, but less than LevelWarn and LevelError.
609f1bebffto9961d90fa7