Logrus: Adding Config Options to SetReportCaller

Created on 20 Nov 2018  路  12Comments  路  Source: sirupsen/logrus

Currently, SetReportCaller is a flag that can be toggled on and off.
When set to true, by default, it returns the first frame that does not belong to the Logrus package.
The request is to make this configurable. It must be possible for the user to specify the level of the frame (counting from the last Logrus package) to be returned.

Use case: I have written a wrapper over Logrus. All calls to the logger go through this wrapper. When I set SetReportCaller to true, the File Name, Function Name and Line Numbers of the Wrapper are returned.
I would like to log the File Name, Function Name and Line Numbers of the next calling function in the stack.

enhancement

Most helpful comment

This is not stale ... there is a PR open.

All 12 comments

I'd also like to specify which log levels to add this to, I mainly only want to see the caller for errors.

Related PR: #989

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This is not stale ... there is a PR open.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This is not stale ... there is a PR open.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This is not stale ... there is a PR open.

8-)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This is not stale ... there is a PR open.

8-)

this.

hi bots - there's still a PR open

Was this page helpful?
0 / 5 - 0 ratings