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

Merged
merged 1 commit into from Apr 2, 2019
Merged

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

merged 1 commit into from Apr 2, 2019

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 commented Apr 2, 2019

@hrxu01 thanks for your contribution

@dgsb dgsb merged commit 717f2cc into sirupsen:master Apr 2, 2019
@hrxu01 hrxu01 deleted the remove_field_if_val_is_empty_for_func_file_filed branch April 2, 2019 08:05
cgxxv pushed a commit to cgxxv/logrus that referenced this pull request Mar 25, 2022
…pty_for_func_file_filed

remove field if val is empty string for func and file field
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

2 participants