- Add --log-format flag (text/json) and --verbosity flag (debug/info/warn/error)
- Replace all log.Printf with slog.Info/Debug/Warn with structured key-value attrs
- Replace all log.Fatalf with slog.Error + os.Exit(1)
- Convert gitea/client.go warnings to slog.Warn
- Add comprehensive tests for logger initialization and level filtering
Closes#23
Partially addresses #32
gpt-review-bot
approved these changes 2026-05-02 18:02:47 +00:00
The pull request comprehensively replaces all legacy log.Printf and log.Fatalf calls with structured and level-based slog logging, introduces configuration flags, and includes robust tests for logger setup. The changes are correct and idiomatic, improving both logging clarity and operational control.
Recommendation
APPROVE — Excellent work replacing unstructured logging with the standard library's slog in a systematic, robust, and idiomatic way. The addition of configuration flags for log format and level, as well as direct tests for each format and filter level, ensures maintainability and operational flexibility. No issues found—ready to merge.
Review by gpt
# Gpt Review
## Summary
The pull request comprehensively replaces all legacy log.Printf and log.Fatalf calls with structured and level-based slog logging, introduces configuration flags, and includes robust tests for logger setup. The changes are correct and idiomatic, improving both logging clarity and operational control.
## Recommendation
**APPROVE** — Excellent work replacing unstructured logging with the standard library's slog in a systematic, robust, and idiomatic way. The addition of configuration flags for log format and level, as well as direct tests for each format and filter level, ensures maintainability and operational flexibility. No issues found—ready to merge.
---
*Review by gpt*
<!-- review-bot:gpt -->
Migration to structured slog logging adds format/verbosity controls and replaces fatal exits with explicit os.Exit without introducing security risks. Inputs are validated, sensitive values (tokens/keys) are not logged, and path handling for system prompts includes robust traversal checks.
Recommendation
APPROVE — CI has passed and the changes are security-neutral or slightly improved in terms of clarity. The new logging avoids exposing secrets and continues to validate and constrain file paths correctly (including symlink resolution). No exploitable vulnerabilities were introduced. Proceed with merge.
Review by security
# Security Review
## Summary
Migration to structured slog logging adds format/verbosity controls and replaces fatal exits with explicit os.Exit without introducing security risks. Inputs are validated, sensitive values (tokens/keys) are not logged, and path handling for system prompts includes robust traversal checks.
## Recommendation
**APPROVE** — CI has passed and the changes are security-neutral or slightly improved in terms of clarity. The new logging avoids exposing secrets and continues to validate and constrain file paths correctly (including symlink resolution). No exploitable vulnerabilities were introduced. Proceed with merge.
---
*Review by security*
<!-- review-bot:security -->
Solid migration from log.Printf/Fatalf to Go's stdlib slog with sensible defaults, CLI flags for format and level, and good test coverage. The changes are idiomatic, maintain existing behavior (exiting on fatal errors), and improve structure and observability.
Recommendation
APPROVE — CI is green and the refactor to slog is clean and idiomatic. The new setupLogger honors format and level via flags/env, error paths now use structured logs plus os.Exit, and tests cover JSON/text formatting and level filtering. Consider minor follow-ups like routing the initial missing-flags error through slog for consistency and optionally using context.Background() in tests calling logger.Log, but these are non-blocking. Approve as is.
Review by sonnet
# Sonnet Review
## Summary
Solid migration from log.Printf/Fatalf to Go's stdlib slog with sensible defaults, CLI flags for format and level, and good test coverage. The changes are idiomatic, maintain existing behavior (exiting on fatal errors), and improve structure and observability.
## Recommendation
**APPROVE** — CI is green and the refactor to slog is clean and idiomatic. The new setupLogger honors format and level via flags/env, error paths now use structured logs plus os.Exit, and tests cover JSON/text formatting and level filtering. Consider minor follow-ups like routing the initial missing-flags error through slog for consistency and optionally using context.Background() in tests calling logger.Log, but these are non-blocking. Approve as is.
---
*Review by sonnet*
<!-- review-bot:sonnet -->
rodin
merged commit cdd4f4fdf4 into main2026-05-02 18:07:13 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Replaces all bare
log.Printf/log.Fatalfcalls with Go stdliblog/slogstructured logging.Changes
--log-format(text/json) and--verbosity(debug/info/warn/error)log.Printf→slog.Info/slog.Debug/slog.Warnwith structured key-value attributeslog.Fatalf→slog.Error+os.Exit(1)gitea/client.gowarnings converted toslog.WarnStructured attributes used
pr,repo,verdict,findings,model,tokens,bytes,duration,error,file,event,review_id,user,comment_id, etc.No third-party dependencies
Uses only
log/slogfrom Go stdlib.Closes #23
Partially addresses #32
Gpt Review
Summary
The pull request comprehensively replaces all legacy log.Printf and log.Fatalf calls with structured and level-based slog logging, introduces configuration flags, and includes robust tests for logger setup. The changes are correct and idiomatic, improving both logging clarity and operational control.
Recommendation
APPROVE — Excellent work replacing unstructured logging with the standard library's slog in a systematic, robust, and idiomatic way. The addition of configuration flags for log format and level, as well as direct tests for each format and filter level, ensures maintainability and operational flexibility. No issues found—ready to merge.
Review by gpt
Security Review
Summary
Migration to structured slog logging adds format/verbosity controls and replaces fatal exits with explicit os.Exit without introducing security risks. Inputs are validated, sensitive values (tokens/keys) are not logged, and path handling for system prompts includes robust traversal checks.
Recommendation
APPROVE — CI has passed and the changes are security-neutral or slightly improved in terms of clarity. The new logging avoids exposing secrets and continues to validate and constrain file paths correctly (including symlink resolution). No exploitable vulnerabilities were introduced. Proceed with merge.
Review by security
Sonnet Review
Summary
Solid migration from log.Printf/Fatalf to Go's stdlib slog with sensible defaults, CLI flags for format and level, and good test coverage. The changes are idiomatic, maintain existing behavior (exiting on fatal errors), and improve structure and observability.
Recommendation
APPROVE — CI is green and the refactor to slog is clean and idiomatic. The new setupLogger honors format and level via flags/env, error paths now use structured logs plus os.Exit, and tests cover JSON/text formatting and level filtering. Consider minor follow-ups like routing the initial missing-flags error through slog for consistency and optionally using context.Background() in tests calling logger.Log, but these are non-blocking. Approve as is.
Review by sonnet