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

Debug traits for structs #20

Merged
merged 2 commits into from Sep 1, 2017

Conversation

Projects
None yet
2 participants
@shivanth
Copy link
Contributor

shivanth commented Aug 22, 2017

Fixes #14

@KodrAus
Copy link
Collaborator

KodrAus left a comment

Thanks @shivanth!

@@ -459,6 +460,19 @@ impl Log for Logger {
fn flush(&self) {}
}

impl fmt::Debug for Logger{

This comment has been minimized.

@KodrAus

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.

@shivanth

shivanth Sep 1, 2017

Author Contributor

Done :-)

@@ -4,6 +4,7 @@ use std::fmt;

use self::regex::Regex;

#[derive(Debug)]

This comment has been minimized.

@KodrAus

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.

@shivanth

shivanth Sep 1, 2017

Author Contributor

Any comments on this ?

This comment has been minimized.

@KodrAus

KodrAus Sep 1, 2017

Collaborator

I think this is ok. Let's merge this in.

@KodrAus 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
You can’t perform that action at this time.