feat: implement logger #74

Merged
dudzic_wiktor merged 1 commits from logger into main 2026-04-16 13:00:48 +00:00
Collaborator
No description provided.
dudzic_wiktor requested review from goc_marek 2026-04-15 13:21:52 +00:00
dudzic_wiktor requested review from goc_daniel 2026-04-15 13:21:52 +00:00
Author
Collaborator

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.

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.
goc_daniel requested changes 2026-04-16 09:12:54 +00:00
Dismissed
goc_daniel left a comment
Owner

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)

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"
Owner

I feel like it belongs to utils.

I feel like it belongs to utils.
dudzic_wiktor marked this conversation as resolved
@@ -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"`
Owner

Possibly it's own config, but no need to in my opinion

Possibly it's own config, but no need to in my opinion
dudzic_wiktor marked this conversation as resolved
@@ -76,2 +76,4 @@
response, rawRefreshToken, err := h.authService.Login(&req)
if err != nil {
logger.Error("login failed",
Owner

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.

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.
dudzic_wiktor marked this conversation as resolved
@@ -0,0 +39,4 @@
case slog.LevelWarn:
color = yellow
case slog.LevelInfo:
color = green
Owner

maybe blue? Like road signs. Probably deep blue. Should definitely be more contrasting with terminal background than LevelDebug, but less than LevelWarn and LevelError.

maybe blue? Like road signs. Probably deep blue. Should definitely be more contrasting with terminal background than LevelDebug, but less than LevelWarn and LevelError.
dudzic_wiktor marked this conversation as resolved
dudzic_wiktor added 1 commit 2026-04-16 12:46:15 +00:00
dudzic_wiktor force-pushed logger from 609f1bebff to 9961d90fa7 2026-04-16 12:46:15 +00:00 Compare
dudzic_wiktor requested review from goc_daniel 2026-04-16 12:46:46 +00:00
goc_daniel approved these changes 2026-04-16 12:59:58 +00:00
dudzic_wiktor merged commit 70e0e23ace into main 2026-04-16 13:00:48 +00:00
dudzic_wiktor deleted branch logger 2026-04-16 13:00:48 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: goc_daniel/b2b#74