Skip to content

Conversation

@thockin
Copy link
Contributor

@thockin thockin commented Dec 5, 2021

Add a new Option MaxLogDepth which tells funcr how many levels of nested fields (e.g. a struct that contains a struct that contains a struct, etc.) it may log. Every time it finds a struct, slice, array, or map the depth is increased by one. When the maximum is reached, the value will be converted to a string indicating that the max depth has been exceeded. If this field is not specified, a default value will be used.

Fixes #123

Add a new Option `MaxLogDepth` which  tells funcr how many levels of
nested fields (e.g. a struct that contains a struct that contains a
struct, etc.) it may log.  Every time it finds a struct, slice, array,
or map the depth is increased by one.  When the maximum is reached, the
value will be converted to a string indicating that the max depth has
been exceeded.  If this field is not specified, a default value will be
used.
@pohly pohly merged commit 99e02a9 into go-logr:master Dec 5, 2021
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.

funcr doesn't handle recursive pointers well

2 participants