Loading
Commits on Source 4
-
GitLab Renovate Bot authored
-
Elliot Forbes authored
chore(deps): update pre-commit hook gitlab-com/gl-infra/common-ci-tasks to v3.19 See merge request gitlab-org/labkit!431 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by: GitLab Renovate Bot <ops-contact+gl-common-ci-tasks-self-renovate@gitlab.com>
-
Vasilii Iakliushin authored
**Problem** `log.FromContext` panics when called on a context that hasn't been seeded with a logger via `WithLogger`. This forces every consumer — including every test file — to defensively seed contexts before any code path that touches logging. In gitlab-shell alone, the labkit/v2 migration required adding boilerplate in 11+ test call sites across 6 files. **Solution** Return `slog.Default()` when no logger is found in context, following the precedent set by commit 4922f016 which replaced a panic with a graceful `New()` fallback in `WithFields` for the same safety reasons. The standard library's `slog` package itself follows this philosophy. Changelog: fixed
-
Elliot Forbes authored
fix(v2/log): Replace panic with slog.Default() fallback in FromContext See merge request !443 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by:
Vasilii Iakliushin <viakliushin@gitlab.com>