Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDebug traits for structs #20
Conversation
| @@ -459,6 +460,19 @@ impl Log for Logger { | |||
| fn flush(&self) {} | |||
| } | |||
|
|
|||
| impl fmt::Debug for Logger{ | |||
This comment has been minimized.
This comment has been minimized.
KodrAus
Aug 27, 2017
Collaborator
There are some nice helper methods on Formatter that can make this easier. So you could have something like:
f.debug_struct("Logger")
.field("directives", &self.directives)
.field("filter", &self.filter)
.field("target", &self.target)
.finish()
This comment has been minimized.
This comment has been minimized.
| @@ -4,6 +4,7 @@ use std::fmt; | |||
|
|
|||
| use self::regex::Regex; | |||
|
|
|||
| #[derive(Debug)] | |||
This comment has been minimized.
This comment has been minimized.
KodrAus
Aug 27, 2017
Collaborator
Do we want the debug representation to display the values of these private internal fields? Right now this will output the debug value of the inner: Regex field. We may well want that, but I think it's worth making that decision explicit. Are you ok with this @sebasmagri?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
KodrAus
merged commit c01ccca
into
sebasmagri:master
Sep 1, 2017
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
shivanth commentedAug 22, 2017
Fixes #14