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

Add Stringer field which will call String() method #32

Merged
merged 1 commit into from Apr 12, 2016
Merged

Conversation

prashantv
Copy link
Collaborator

This avoids some line noise in log call sites when passing things like net.IP, since code like:

zap.Info("Started.", zap.String("ip", ipAddr.String()))

becomes:

zap.Info("Started.", zap.Stringer("ip", ipAddr))

@blampe
Copy link

blampe commented Apr 12, 2016

Type safety is so cool 👍

@akshayjshah akshayjshah merged commit c263c9e into master Apr 12, 2016
@akshayjshah akshayjshah deleted the stringer branch May 27, 2016 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants