Skip to content

Commit c6e4cca

Browse files
chore(deps): update module dev.gaijin.team/go/golib to v0.8.0 (#7627)
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [dev.gaijin.team/go/golib](https://redirect.github.com/GaijinEntertainment/golib) | `v0.7.0` -> `v0.8.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/dev.gaijin.team%2fgo%2fgolib/v0.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/dev.gaijin.team%2fgo%2fgolib/v0.7.0/v0.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>GaijinEntertainment/golib (dev.gaijin.team/go/golib)</summary> ### [`v0.8.0`](https://redirect.github.com/GaijinEntertainment/golib/releases/tag/v0.8.0) [Compare Source](https://redirect.github.com/GaijinEntertainment/golib/compare/v0.7.0...v0.8.0) **Major release with breaking changes to logger and stacktrace packages. Please review the Breaking Changes section carefully before upgrading.** This release focuses on improving the logger and stacktrace packages with better caller capture, thread safety, and a simplified adapter interface. *** ##### ⚠️ Breaking Changes - **Change `logger.New()` constructor signature** ([`a818939`](https://redirect.github.com/GaijinEntertainment/golib/commit/a818939), [`dbbf7a2`](https://redirect.github.com/GaijinEntertainment/golib/commit/dbbf7a2), [`ef40e6a`](https://redirect.github.com/GaijinEntertainment/golib/commit/ef40e6a)) Constructor changed from `New(adapter Adapter, maxLevel int)` to `New(adapter Adapter, opts ...Option)`. The `maxLevel` parameter is now passed via `WithLevel(level)` option. - **Rework `logger.Adapter` interface** ([`3e99e98`](https://redirect.github.com/GaijinEntertainment/golib/commit/3e99e98)) The Adapter interface has been simplified. Logger name and stacktrace functionality is now handled by the logger itself, with these values passed as fields. - **Remove `NopAdapter` and change nil adapter handling** ([`ac007a8`](https://redirect.github.com/GaijinEntertainment/golib/commit/ac007a8)) `NopAdapter` has been removed. All loggers with nil adapter are now treated as no-op loggers. No-op loggers can only be created with `logger.NewNop()`. `logger.New()` now panics if it receives a nil adapter. - **Change logger name and error passthrough mechanism** ([`dbbf7a2`](https://redirect.github.com/GaijinEntertainment/golib/commit/dbbf7a2)) Logger name and error are now passed to adapters as fields rather than handled in a special way. - **Rework `stacktrace` package API** ([`7d77230`](https://redirect.github.com/GaijinEntertainment/golib/commit/7d77230), [`e4d4715`](https://redirect.github.com/GaijinEntertainment/golib/commit/e4d4715)) `stacktrace.Capture()` renamed to `stacktrace.CaptureStack()`. `Stack` type is now read-only; modification methods have been removed. *** ##### Added - **New logger configuration options** ([`a818939`](https://redirect.github.com/GaijinEntertainment/golib/commit/a818939), [`dbbf7a2`](https://redirect.github.com/GaijinEntertainment/golib/commit/dbbf7a2), [`ef40e6a`](https://redirect.github.com/GaijinEntertainment/golib/commit/ef40e6a)) Added multiple new options for configuring logger behavior: - `WithLevel(level int)` - Set maximum log level - `WithCallerAtLevel(level int)` - Enable automatic caller capture at or below specified level - `WithCallerMapper(fn)` - Custom caller frame mapping with `DefaultCallerMapper` provided - `WithNameMapper(fn)` - Custom logger name field mapping - `WithNameFormatter(fn)` - Custom logger name formatting (hierarchical with `:` or replacement strategies) - `WithErrorMapper(fn)` - Custom error field mapping - `WithStackTraceMapper(fn)` - Custom stacktrace field mapping - **New `stacktrace.CaptureCaller()` function** ([`e4d4715`](https://redirect.github.com/GaijinEntertainment/golib/commit/e4d4715)) Captures a single stack frame with specified skip. More performant for cases when only the caller's frame is required. - **New `stacktrace.Frame` type** ([`6b86721`](https://redirect.github.com/GaijinEntertainment/golib/commit/6b86721)) Represents a single stack frame containing program counter, file path, line number, and function name. Simplified representation of `runtime.Frame` that is safe to store and use after stack trace capture. - **Logger comparison method** ([`ef40e6a`](https://redirect.github.com/GaijinEntertainment/golib/commit/ef40e6a)) New `logger.IsEqual()` method for comparing if two loggers are functionally the same. - **Thread-safe buffer adapter improvements** ([`bb3745f`](https://redirect.github.com/GaijinEntertainment/golib/commit/bb3745f)) `bufferadapter.LogEntries` type is now thread-safe. New `bufferadapter.NewWithBuffer()` method allows usage of pre-existing buffer. - **Stacktrace capture support** ([`dbbf7a2`](https://redirect.github.com/GaijinEntertainment/golib/commit/dbbf7a2)) Full stacktrace capture functionality integrated into logger package. *** ##### Changed - **Finalize logger documentation** ([`dbbf7a2`](https://redirect.github.com/GaijinEntertainment/golib/commit/dbbf7a2)) Comprehensive documentation added to the logger package. - **Improve adapter documentation** ([`3e99e98`](https://redirect.github.com/GaijinEntertainment/golib/commit/3e99e98)) Added detailed package documentation for `logrusadapter`, `slogadapter`, and `zapadapter`. - **Simplify `bufferadapter.New()`** ([`bb3745f`](https://redirect.github.com/GaijinEntertainment/golib/commit/bb3745f)) Now creates and returns both adapter and buffer together for convenience. - **Upgrade golangci-lint configuration** ([`17f1b9c`](https://redirect.github.com/GaijinEntertainment/golib/commit/17f1b9c)) Updated linter config to support golangci-lint v2.6 and fixed all lint issues. *** ##### Fixed - **Fix logger name carrying with multiple children** ([`ef40e6a`](https://redirect.github.com/GaijinEntertainment/golib/commit/ef40e6a)) Previously, when multiple child loggers changed names, it would result in multiple fields with the same name. The new approach allows for logger name rewrites and custom logger name generation strategies. *** #### Upgrade Guide ##### For Logger Users: **1. Updating logger.New() calls:** ```go // Before (v0.7.0) logger := logger.New(adapter, logger.LevelDebug) // After (v0.8.0) logger := logger.New(adapter, logger.WithLevel(logger.LevelDebug)) // Or use default level (LevelInfo) with no options logger := logger.New(adapter) ``` **2. Creating no-op loggers:** ```go // Before logger := logger.New(logger.NopAdapter{}, someLevel) // After logger := logger.NewNop() ``` **3. Calling stacktrace functions:** ```go // Before stack := stacktrace.Capture(skip) // After stack := stacktrace.CaptureStack(skip) // Or for single frame: frame := stacktrace.CaptureCaller(skip) ``` **4. Modifying Stack instances:** Remove any code that modifies Stack - it's now read-only. Capture the stack with the correct skip value instead. ##### For Adapter Implementers: The `Adapter` interface has been simplified. Logger name and stacktrace functionality is now handled by the logger itself, with these values passed as fields. Review the updated documentation in `logrusadapter`, `slogadapter`, and `zapadapter` packages for examples of the new implementation pattern. *** #### Contributors - a.zinoviev <a.zinoviev@gaijin.team> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/open-telemetry/opentelemetry-go). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xNi4xIiwidXBkYXRlZEluVmVyIjoiNDIuMTYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent da01323 commit c6e4cca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
codeberg.org/chavacava/garif v0.2.0 // indirect
2424
dario.cat/mergo v1.0.2 // indirect
2525
dev.gaijin.team/go/exhaustruct/v4 v4.0.0 // indirect
26-
dev.gaijin.team/go/golib v0.7.0 // indirect
26+
dev.gaijin.team/go/golib v0.8.0 // indirect
2727
github.com/4meepo/tagalign v1.4.3 // indirect
2828
github.com/Abirdcfly/dupword v0.1.7 // indirect
2929
github.com/AdminBenni/iota-mixing v1.0.0 // indirect

internal/tools/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
88
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
99
dev.gaijin.team/go/exhaustruct/v4 v4.0.0 h1:873r7aNneqoBB3IaFIzhvt2RFYTuHgmMjoKfwODoI1Y=
1010
dev.gaijin.team/go/exhaustruct/v4 v4.0.0/go.mod h1:aZ/k2o4Y05aMJtiux15x8iXaumE88YdiB0Ai4fXOzPI=
11-
dev.gaijin.team/go/golib v0.7.0 h1:Ho2217eFXSnP78iCX21Bq7KkcY8b2cJJULtc5SXOeF0=
12-
dev.gaijin.team/go/golib v0.7.0/go.mod h1:c5fu7t1RSGMxSQgcUYO1sODbzsYnOCXJLmHeNG1Eb+0=
11+
dev.gaijin.team/go/golib v0.8.0 h1:BiDNudpoFizoU5VHdQUiabtHSt9fyPX11Fr4OU9PaUQ=
12+
dev.gaijin.team/go/golib v0.8.0/go.mod h1:c5fu7t1RSGMxSQgcUYO1sODbzsYnOCXJLmHeNG1Eb+0=
1313
github.com/4meepo/tagalign v1.4.3 h1:Bnu7jGWwbfpAie2vyl63Zup5KuRv21olsPIha53BJr8=
1414
github.com/4meepo/tagalign v1.4.3/go.mod h1:00WwRjiuSbrRJnSVeGWPLp2epS5Q/l4UEy0apLLS37c=
1515
github.com/Abirdcfly/dupword v0.1.7 h1:2j8sInznrje4I0CMisSL6ipEBkeJUJAmK1/lfoNGWrQ=

0 commit comments

Comments
 (0)