Skip to content

chore(deps): update module dev.gaijin.team/go/golib to v0.8.0#219

Merged
flc1125 merged 1 commit intov2.xfrom
renovate/dev.gaijin.team-go-golib-0.x
Nov 23, 2025
Merged

chore(deps): update module dev.gaijin.team/go/golib to v0.8.0#219
flc1125 merged 1 commit intov2.xfrom
renovate/dev.gaijin.team-go-golib-0.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Nov 21, 2025

This PR contains the following updates:

Package Change Age Confidence
dev.gaijin.team/go/golib v0.7.0 -> v0.8.0 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

GaijinEntertainment/golib (dev.gaijin.team/go/golib)

v0.8.0

Compare Source

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, dbbf7a2, 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)
    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)
    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)
    Logger name and error are now passed to adapters as fields rather than handled in a special way.

  • Rework stacktrace package API (7d77230, e4d4715)
    stacktrace.Capture() renamed to stacktrace.CaptureStack(). Stack type is now read-only; modification methods have been removed.


Added
  • New logger configuration options (a818939, dbbf7a2, 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)
    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)
    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)
    New logger.IsEqual() method for comparing if two loggers are functionally the same.

  • Thread-safe buffer adapter improvements (bb3745f)
    bufferadapter.LogEntries type is now thread-safe. New bufferadapter.NewWithBuffer() method allows usage of pre-existing buffer.

  • Stacktrace capture support (dbbf7a2)
    Full stacktrace capture functionality integrated into logger package.


Changed
  • Finalize logger documentation (dbbf7a2)
    Comprehensive documentation added to the logger package.

  • Improve adapter documentation (3e99e98)
    Added detailed package documentation for logrusadapter, slogadapter, and zapadapter.

  • Simplify bufferadapter.New() (bb3745f)
    Now creates and returns both adapter and buffer together for convenience.

  • Upgrade golangci-lint configuration (17f1b9c)
    Updated linter config to support golangci-lint v2.6 and fixed all lint issues.


Fixed
  • Fix logger name carrying with multiple children (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:

// 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:

// Before
logger := logger.New(logger.NopAdapter{}, someLevel)

// After
logger := logger.NewNop()

3. Calling stacktrace functions:

// 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


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 becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Nov 21, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 21, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (902a587) to head (d04cb67).
⚠️ Report is 3 commits behind head on v2.x.

Additional details and impacted files
@@           Coverage Diff           @@
##             v2.x     #219   +/-   ##
=======================================
  Coverage   92.27%   92.27%           
=======================================
  Files           1        1           
  Lines         207      207           
=======================================
  Hits          191      191           
  Misses         11       11           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 23, 2025
@flc1125 flc1125 merged commit 87e7f7c into v2.x Nov 23, 2025
12 checks passed
@flc1125 flc1125 deleted the renovate/dev.gaijin.team-go-golib-0.x branch November 23, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant