mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-13 03:28:09 -07:00
config: Parse logger config
This commit is contained in:
+16
-2
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user