Merge pull request #148 from noxiouz/remove_unused_regexp

Remove unused regexp
This commit is contained in:
Simon Eskildsen 2015-03-19 10:06:15 -04:00
commit 2471adf231
3 changed files with 7 additions and 7 deletions

View File

@ -11,11 +11,12 @@ type JSONFormatter struct{}
func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {
data := make(Fields, len(entry.Data)+3) data := make(Fields, len(entry.Data)+3)
for k, v := range entry.Data { for k, v := range entry.Data {
// Otherwise errors are ignored by `encoding/json` switch v := v.(type) {
// https://github.com/Sirupsen/logrus/issues/137 case error:
if err, ok := v.(error); ok { // Otherwise errors are ignored by `encoding/json`
data[k] = err.Error() // https://github.com/Sirupsen/logrus/issues/137
} else { data[k] = v.Error()
default:
data[k] = v data[k] = v
} }
} }

View File

@ -1,4 +1,3 @@
package logrus package logrus
import "syscall" import "syscall"

View File

@ -6,7 +6,7 @@ import (
"runtime" "runtime"
) )
func (logger *Logger) Writer() (*io.PipeWriter) { func (logger *Logger) Writer() *io.PipeWriter {
reader, writer := io.Pipe() reader, writer := io.Pipe()
go logger.writerScanner(reader) go logger.writerScanner(reader)