labstack / labstack/gommon

Add possibility to set skip parameter

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
596
Forks
102
PR merge metrics
No merged PRs in 30d

Description

In our code base we are wrapping gommon.Log, however when looking at the log output, the referencing sourcecode and line number are incorrect, since gommon.Log uses a hardcoded skip parameter.

Can we make this parameter public, or make a method to be able to change that?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in log/log.go at the linked hardcoded skip parameter and inspect how gommon.Log uses it when reporting the source location. Make the skip value configurable so wrappers can produce the correct source file and line number; the issue is complete when callers can change that value.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability-sre
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.