mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 16:34:32 +01:00
parent
261d095108
commit
f14dc3107f
@ -15,6 +15,15 @@ func (l Level) MarshalJSON() ([]byte, error) {
|
|||||||
return json.Marshal(l.String())
|
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 (
|
const (
|
||||||
Debug Level = iota
|
Debug Level = iota
|
||||||
Info
|
Info
|
||||||
|
Loading…
Reference in New Issue
Block a user