2018-08-26 19:15:48 +08:00
|
|
|
//
|
|
|
|
// Copyright (c) 2018
|
|
|
|
// Mainflux
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
//
|
|
|
|
|
2018-04-04 16:15:23 +08:00
|
|
|
package logger
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Error level is used when logging errors.
|
|
|
|
Error Level = iota + 1
|
|
|
|
// Warn level is used when logging warnings.
|
|
|
|
Warn
|
|
|
|
// Info level is used when logging info data.
|
|
|
|
Info
|
|
|
|
)
|
|
|
|
|
|
|
|
// Level represents severity level while logging.
|
|
|
|
type Level int
|
|
|
|
|
|
|
|
var levels = map[Level]string{
|
|
|
|
Error: "error",
|
|
|
|
Warn: "warn",
|
|
|
|
Info: "info",
|
|
|
|
}
|
|
|
|
|
|
|
|
func (lvl Level) String() string {
|
|
|
|
return levels[lvl]
|
|
|
|
}
|