1
0
Fork 0
forked from External/ergo

config: Parse logger config

This commit is contained in:
Daniel Oaks 2017-03-06 13:31:10 +10:00
parent a982d965f1
commit 1ddeec9225
2 changed files with 66 additions and 3 deletions

View file

@ -14,8 +14,10 @@ import (
type LogLevel int
const (
// LogErr is an error value.
LogErr LogLevel = iota
// LogDebug represents debug messages.
LogDebug LogLevel = iota
LogDebug
// LogInfo represents informational messages.
LogInfo
// LogWarn represents warnings.
@ -24,6 +26,18 @@ const (
LogError
)
var (
logLevelNames = map[string]LogLevel{
"debug": LogDebug,
"info": LogInfo,
"warn": LogWarn,
"warning": LogWarn,
"warnings": LogWarn,
"error": LogError,
"errors": LogError,
}
)
// ClientLogger is a logger dedicated to a single client. This is a convenience class that
// automagically adds the client nick to logged messages.
type ClientLogger struct {
@ -50,7 +64,7 @@ type Logger struct {
}
// NewLogger returns a new Logger.
func NewLogger(config LogConfig) (*Logger, error) {
func NewLogger(config LoggingConfig) (*Logger, error) {
return nil, fmt.Errorf("Not implemented")
}