You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: simplify logging functions and introduce LogLevel
This commit refactors the logging functions by removing the level parameter from the Log function, making it a shorthand for logging at the Error level. A new LogLevel function is introduced to allow logging at specified levels. Additionally, tests are updated to reflect these changes, and documentation is revised to guide users on the new logging approach.
Copy file name to clipboardExpand all lines: MIGRATION.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,14 @@ Version 0.5.0 is a **breaking change** release that replaces the custom field sy
14
14
- ✅ **Added**: `slog.LogValuer` implementation
15
15
- ✅ **Added**: Grouped attributes via `slog.Group`
16
16
- ✅ **Added**: `errors.Attrs(err)` to extract attributes
17
-
- ✅ **Added**: `errors.Log(ctx, logger, level, err)` for slog logging
17
+
- ✅ **Added**: `errors.Log(ctx, logger, err)` and `errors.LogLevel(ctx, logger, level, err)` for slog logging
18
18
- 📦 **Minimum Go version**: 1.21 (for `log/slog` support)
19
19
20
20
## Quick Migration Checklist
21
21
22
22
-[ ] Update Go version to 1.21 or higher
23
23
-[ ] Remove imports of `errors/logging/logrusadapter`
24
-
-[ ] Replace old `errors.Log(err, logger)` calls with new `errors.Log(ctx, logger, level, err)` or direct slog usage
24
+
-[ ] Replace old `errors.Log(err, logger)` calls with new `errors.Log(ctx, logger, err)` or `errors.LogLevel(ctx, logger, level, err)` or direct slog usage
0 commit comments