logger: json serialization of log level is a string

This commit is contained in:
Christian Schwarz 2017-09-24 19:39:44 +02:00
parent 03955196a9
commit 7c86628f3b

View File

@ -2,6 +2,7 @@ package logger
import ( import (
"context" "context"
"encoding/json"
"fmt" "fmt"
"github.com/pkg/errors" "github.com/pkg/errors"
"time" "time"
@ -9,6 +10,10 @@ import (
type Level int type Level int
func (l Level) MarshalJSON() ([]byte, error) {
return json.Marshal(l.String())
}
const ( const (
Debug Level = iota Debug Level = iota
Info Info