MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / MarshalJSON

Method MarshalJSON

config/log.go:95–101  ·  view source on GitHub ↗

MarshalJSON marshals a level number to a JSON string

()

Source from the content-addressed store, hash-verified

93
94// MarshalJSON marshals a level number to a JSON string
95func (level LogLevel) MarshalJSON() ([]byte, error) {
96 levelString, err := level.Name()
97 if err != nil {
98 return nil, err
99 }
100 return json.Marshal(levelString)
101}
102
103// UnmarshalYAML decodes a YAML level string to a level type.
104func (level *LogLevel) UnmarshalYAML(unmarshal func(interface{}) error) error {

Callers

nothing calls this directly

Calls 2

NameMethod · 0.95
MarshalMethod · 0.65

Tested by

no test coverage detected