Add a Log method on Scheme for better debugging

This commit is contained in:
Clayton Coleman
2014-10-05 17:17:25 -04:00
parent f9e5477e2b
commit 305db35422
3 changed files with 24 additions and 0 deletions

View File

@@ -86,6 +86,11 @@ func NewScheme() *Scheme {
return s
}
// Log sets a logger on the scheme. For test purposes only
func (s *Scheme) Log(l DebugLogger) {
s.converter.Debug = l
}
// nameFunc returns the name of the type that we wish to use for encoding. Defaults to
// the go name of the type if the type is not registered.
func (s *Scheme) nameFunc(t reflect.Type) string {