Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust runtime caller offset if necessary #51

Merged
merged 2 commits into from
Oct 25, 2019
Merged

Conversation

drewbailey
Copy link
Contributor

First check if initial offset is inside a logger implementation file (interceptlogger.go, intlogger.go) if it is, increase the offset by 1

regex to check if caller is inside a logger implemenation file
@drewbailey drewbailey requested a review from evanphx October 25, 2019 20:51
@@ -133,7 +133,7 @@ func TestLogger(t *testing.T) {
rest := str[dataIdx+1:]

// This test will break if you move this around, it's line dependent, just fyi
assert.Equal(t, "[INFO] go-hclog/logger_test.go:146: test: this is test: who=programmer why=\"testing is fun\"\n", rest)
assert.Equal(t, "[INFO] go-hclog/logger_test.go:129: test: this is test: who=programmer why=\"testing is fun\"\n", rest)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the calling loc here seems to be 129 here so not sure why it was 146 earlier https://github.com/hashicorp/go-hclog/pull/51/files#diff-0d02175655a9ca1a852edb40e80012b1R129

@evanphx evanphx merged commit 2348337 into master Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants