mirror of
https://github.com/zrepl/zrepl.git
synced 2025-01-02 20:38:50 +01:00
logger: json serialization of log level is a string
This commit is contained in:
parent
03955196a9
commit
7c86628f3b
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user