docs: update logging docs for slog-native architecture#73
Conversation
Update all logging references to reflect the slog-native Handler: - howto/Log.md: rewrite backends section (SetDefault/NewHandler/NewHandlerWithInner), update context-aware logs to show AddAttrsToContext + slog.LogAttrs, update OverrideLogLevel example with slog - Packages.md: rewrite log package description for slog-native - Index.md: update feature table and package table - FAQ.md: SetLogger -> SetDefault - howto/production.md: fix wrong function name (AddToLogContext -> AddToContext) Ref: go-coldbrew/log#27
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated documentation across multiple markdown files to reflect a migration to a slog-native logging model using a custom Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@howto/Log.md`:
- Around line 54-61: The example init function uses os.Stdout but the import
block is missing the "os" package; update the import list to include "os" so the
snippet compiles. Specifically, in the example containing func init() and
variables inner, call to slog.NewJSONHandler(os.Stdout, nil), and
log.SetDefault(log.NewHandlerWithInner(inner)), add "os" to the import block
alongside "log/slog" and "github.com/go-coldbrew/log".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 00c07321-05df-4ad9-bdf4-e1ca35ef6a03
📒 Files selected for processing (5)
FAQ.mdIndex.mdPackages.mdhowto/Log.mdhowto/production.md
There was a problem hiding this comment.
Pull request overview
Updates ColdBrew documentation to reflect the newer slog-native logging architecture and APIs, replacing older logger configuration patterns and correcting outdated references.
Changes:
- Rewrites logging guidance to emphasize native
slogusage (slog.LogAttrs) and the framework-provided composableslog.Handler. - Updates docs/examples to use
log.SetDefault,log.AddAttrsToContext, andlog.AddToContext, including a production doc fix. - Refreshes package/feature descriptions to describe slog-native logging behavior and context field injection.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Packages.md | Updates the log package description to reflect slog-native handler-based logging and context field injection. |
| Index.md | Updates the “Structured Logging” feature and the log module description to describe slog-native logging. |
| howto/production.md | Fixes/updates logging context API references in production data handling documentation. |
| howto/Log.md | Rewrites the logging how-to to use slog-native APIs and updated ColdBrew logging helpers. |
| FAQ.md | Updates init-only configuration examples to reference log.SetDefault() instead of log.SetLogger(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add concrete examples showing how to compose ColdBrew's Handler with custom inner handlers, slog-multi fan-out, and external middleware wrapping. All done through the log package via NewHandlerWithInner.
Add context, net/http, os imports to code examples so they compile when copy-pasted. Addresses Copilot review comments.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
howto/Log.md— replace BaseLogger/SetLogger/cbslog patterns with slog-native (SetDefault,NewHandler,NewHandlerWithInner,slog.LogAttrs,AddAttrsToContext)AddAttrsToContext(typed) andAddToContext(untyped)slog.LogAttrshowto/production.md:log.AddToLogContext()→log.AddToContext()Index.mdfeature table and package tablePackages.mdlog package descriptionFAQ.md:log.SetLogger()→log.SetDefault()Test plan
Ref: go-coldbrew/log#27
Summary by CodeRabbit