mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 00:13:52 +01:00
parent
261d095108
commit
f14dc3107f
@ -15,6 +15,15 @@ func (l Level) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(l.String())
|
||||
}
|
||||
|
||||
func (l *Level) UnmarshalJSON(input []byte) (err error) {
|
||||
var s string
|
||||
if err = json.Unmarshal(input, &s); err != nil {
|
||||
return err
|
||||
}
|
||||
*l, err = ParseLevel(s)
|
||||
return err
|
||||
}
|
||||
|
||||
const (
|
||||
Debug Level = iota
|
||||
Info
|
||||
|
Loading…
Reference in New Issue
Block a user