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

print absoulte file path of caller in log #1

Merged
merged 2 commits into from
Mar 14, 2018

Conversation

joelurraco
Copy link
Contributor

Useful when there are multiple files with the same name in the same project.

This:

2018/03/01 09:43:36 svc=unknown tp=error src=account.go:33 fn=services.(*ServerAuthService).CreateAccount msg=CreateAccount error error=password length is invalid

Becomes:

2018/03/01 09:43:36 svc=unknown tp=error src=/go/src/bitbucket.org/acbapis/microauth/services/account.go:33 fn=services.(*ServerAuthService).CreateAccount msg=CreateAccount error error=password length is invalid

@jllopis
Copy link
Owner

jllopis commented Mar 10, 2018

I am not sure if this will be generally better but understand the need. I think that adding an option in LogConfig
will do better. Use the default or just instruct the logger to output full path.

It is clear that log package needs more work...

@jllopis jllopis merged commit dc7c080 into jllopis:master Mar 14, 2018
@joelurraco joelurraco deleted the absolute_path_logs branch June 27, 2018 11:41
jllopis pushed a commit that referenced this pull request Oct 17, 2018
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.

None yet

3 participants