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

remove field if val is empty string for func and file field #944

Conversation

@hrxu01
Copy link

@hrxu01 hrxu01 commented Apr 2, 2019

Changes are made in text_formatter.go.

Users can set CallerPrettyfier to customize function and file fields, but if users want only one of these two fields, there is no way.

I make some changes so that if users set one field to empty string, logrus will not output that field.

And the json_formatter.go already had this logic.

@dgsb
Copy link
Collaborator

@dgsb dgsb commented Apr 2, 2019

@hrxu01 thanks for your contribution

@dgsb dgsb merged commit 717f2cc into sirupsen:master Apr 2, 2019
2 checks passed
@hrxu01 hrxu01 deleted the remove_field_if_val_is_empty_for_func_file_filed branch Apr 2, 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants