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

file field bad when using std logger #11

Closed
stephenmw opened this issue Apr 17, 2016 · 1 comment
Closed

file field bad when using std logger #11

stephenmw opened this issue Apr 17, 2016 · 1 comment

Comments

@stephenmw
Copy link

Example:

package main

import "github.com/rs/xlog"

func main() {
    xlog.Error("what file is this?")
}

Output:

2016/04/16 22:51:18 ERRO what file is this? file=std.go:44

std.go:44 is xlog code: https://github.com/rs/xlog/blob/master/std.go#L44

Logger assumes that it is being called by the function with the error and not an intermediate function. This causes the file and line number to be taken from std.go instead of the client code.

@rs rs closed this as completed in 0c59c02 Apr 19, 2016
@rs
Copy link
Owner

rs commented Apr 19, 2016

Good catch.

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

No branches or pull requests

2 participants