3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

logger: Move to separate package, make *much* nicer

This commit is contained in:
Daniel Oaks 2017-03-10 22:02:08 +10:00
parent ef9acf53f8
commit 439331cfb8
6 changed files with 160 additions and 86 deletions

View File

@ -264,7 +264,7 @@ func (channel *Channel) Join(client *Client, key string) {
return
}
client.server.logger.Log(LogDebug, "join", fmt.Sprintf("%s joined channel %s", client.nick, channel.name))
client.server.logger.Debug("join", fmt.Sprintf("%s joined channel %s", client.nick, channel.name))
for member := range channel.members {
if member.capabilities[ExtendedJoin] {
@ -306,7 +306,7 @@ func (channel *Channel) Part(client *Client, message string) {
}
channel.Quit(client)
client.server.logger.Log(LogDebug, "part", fmt.Sprintf("%s left channel %s", client.nick, channel.name))
client.server.logger.Debug("part", fmt.Sprintf("%s left channel %s", client.nick, channel.name))
}
func (channel *Channel) GetTopic(client *Client) {

View File

@ -170,7 +170,7 @@ func (client *Client) run() {
maxlenTags, maxlenRest := client.maxlens()
client.server.logger.Log(LogDebug, "userinput ", client.nick, "<- ", line)
client.server.logger.Debug("userinput ", client.nick, "<- ", line)
msg, err = ircmsg.ParseLineMaxLen(line, maxlenTags, maxlenRest)
if err == ircmsg.ErrorLineIsEmpty {
@ -404,7 +404,7 @@ func (client *Client) AllNickmasks() []string {
// SetNickname sets the very first nickname for the client.
func (client *Client) SetNickname(nickname string) error {
if client.HasNick() {
client.server.logger.Log(LogError, "nick", fmt.Sprintf("%s nickname already set, something is wrong with server consistency", client.nickMaskString))
client.server.logger.Error("nick", fmt.Sprintf("%s nickname already set, something is wrong with server consistency", client.nickMaskString))
return ErrNickAlreadySet
}
@ -421,7 +421,7 @@ func (client *Client) ChangeNickname(nickname string) error {
origNickMask := client.nickMaskString
err := client.server.clients.Replace(client.nick, nickname, client)
if err == nil {
client.server.logger.Log(LogDebug, "nick", fmt.Sprintf("%s changed nickname to %s", client.nick, nickname))
client.server.logger.Debug("nick", fmt.Sprintf("%s changed nickname to %s", client.nick, nickname))
client.server.whoWas.Append(client)
client.nick = nickname
client.updateNickMask()
@ -446,7 +446,7 @@ func (client *Client) destroy() {
return
}
client.server.logger.Log(LogDebug, "quit", fmt.Sprintf("%s is no longer on the server", client.nick))
client.server.logger.Debug("quit", fmt.Sprintf("%s is no longer on the server", client.nick))
// send quit/error message to client if they haven't been sent already
client.Quit("Connection closed")
@ -595,7 +595,7 @@ func (client *Client) Send(tags *map[string]ircmsg.TagValue, prefix string, comm
line = line[:len(line)-3] + "\r\n"
}
client.server.logger.Log(LogDebug, "useroutput", client.nick, " ->", strings.TrimRight(line, "\r\n"))
client.server.logger.Debug("useroutput", client.nick, " ->", strings.TrimRight(line, "\r\n"))
client.socket.Write(line)
return nil

View File

@ -15,6 +15,7 @@ import (
"time"
"github.com/DanielOaks/oragono/irc/custime"
"github.com/DanielOaks/oragono/irc/logger"
"gopkg.in/yaml.v2"
)
@ -119,13 +120,14 @@ type ConnectionThrottleConfig struct {
type LoggingConfig struct {
Method string
Methods map[string]bool
MethodStderr bool
MethodFile bool
Filename string
TypeString string `yaml:"type"`
Types map[string]bool `yaml:"real-types"`
ExcludedTypes map[string]bool `yaml:"real-excluded-types"`
LevelString string `yaml:"level"`
Level LogLevel `yaml:"level-real"`
TypeString string `yaml:"type"`
Types []string `yaml:"real-types"`
ExcludedTypes []string `yaml:"real-excluded-types"`
LevelString string `yaml:"level"`
Level logger.Level `yaml:"level-real"`
}
type LineLenConfig struct {
@ -389,26 +391,26 @@ func LoadConfig(filename string) (config *Config, err error) {
var newLogConfigs []LoggingConfig
for _, logConfig := range config.Logging {
// methods
logConfig.Methods = make(map[string]bool)
methods := make(map[string]bool)
for _, method := range strings.Split(logConfig.Method, " ") {
if len(method) > 0 {
logConfig.Methods[strings.ToLower(method)] = true
methods[strings.ToLower(method)] = true
}
}
if logConfig.Methods["file"] && logConfig.Filename == "" {
if methods["file"] && logConfig.Filename == "" {
return nil, errors.New("Logging configuration specifies 'file' method but 'filename' is empty")
}
logConfig.MethodFile = methods["file"]
logConfig.MethodStderr = methods["stderr"]
// levels
level, exists := logLevelNames[strings.ToLower(logConfig.LevelString)]
level, exists := logger.LogLevelNames[strings.ToLower(logConfig.LevelString)]
if !exists {
return nil, fmt.Errorf("Could not translate log leve [%s]", logConfig.LevelString)
}
logConfig.Level = level
// types
logConfig.Types = make(map[string]bool)
logConfig.ExcludedTypes = make(map[string]bool)
for _, typeStr := range strings.Split(logConfig.TypeString, " ") {
if len(typeStr) == 0 {
continue
@ -418,9 +420,9 @@ func LoadConfig(filename string) (config *Config, err error) {
}
if typeStr[0] == '-' {
typeStr = typeStr[1:]
logConfig.ExcludedTypes[typeStr] = true
logConfig.ExcludedTypes = append(logConfig.ExcludedTypes, typeStr)
} else {
logConfig.Types[typeStr] = true
logConfig.Types = append(logConfig.Types, typeStr)
}
}
if len(logConfig.Types) < 1 {

View File

@ -1,7 +1,7 @@
// Copyright (c) 2017 Daniel Oaks <daniel@danieloaks.net>
// released under the MIT license
package irc
package logger
import (
"bufio"
@ -17,62 +17,84 @@ import (
"github.com/mgutz/ansi"
)
// LogLevel represents the level to log messages at.
type LogLevel int
// Level represents the level to log messages at.
type Level int
const (
// LogDebug represents debug messages.
LogDebug LogLevel = iota
LogDebug Level = iota
// LogInfo represents informational messages.
LogInfo
// LogWarn represents warnings.
LogWarn
// LogWarning represents warnings.
LogWarning
// LogError represents errors.
LogError
)
var (
logLevelNames = map[string]LogLevel{
LogLevelNames = map[string]Level{
"debug": LogDebug,
"info": LogInfo,
"warn": LogWarn,
"warning": LogWarn,
"warnings": LogWarn,
"warn": LogWarning,
"warning": LogWarning,
"warnings": LogWarning,
"error": LogError,
"errors": LogError,
}
logLevelDisplayNames = map[LogLevel]string{
LogDebug: "debug",
LogInfo: "info",
LogWarn: "warning",
LogError: "error",
LogLevelDisplayNames = map[Level]string{
LogDebug: "debug",
LogInfo: "info",
LogWarning: "warning",
LogError: "error",
}
)
// Logger is the main interface used to log debug/info/error messages.
type Logger struct {
loggers []SingleLogger
// Manager is the main interface used to log debug/info/error messages.
type Manager struct {
loggers []singleLogger
stderrWriteLock sync.Mutex
DumpingRawInOut bool
}
// NewLogger returns a new Logger.
func NewLogger(config []LoggingConfig) (*Logger, error) {
var logger Logger
// Config represents the configuration of a single logger.
type Config struct {
// logging methods
MethodStderr bool
MethodFile bool
Filename string
// logging level
Level Level
// logging types
Types []string
ExcludedTypes []string
}
// NewManager returns a new log manager.
func NewManager(config ...Config) (*Manager, error) {
var logger Manager
for _, logConfig := range config {
sLogger := SingleLogger{
MethodSTDERR: logConfig.Methods["stderr"],
typeMap := make(map[string]bool)
for _, name := range logConfig.Types {
typeMap[name] = true
}
excludedTypeMap := make(map[string]bool)
for _, name := range logConfig.ExcludedTypes {
excludedTypeMap[name] = true
}
sLogger := singleLogger{
MethodSTDERR: logConfig.MethodStderr,
MethodFile: fileMethod{
Enabled: logConfig.Methods["file"],
Enabled: logConfig.MethodFile,
Filename: logConfig.Filename,
},
Level: logConfig.Level,
Types: logConfig.Types,
ExcludedTypes: logConfig.ExcludedTypes,
Types: typeMap,
ExcludedTypes: excludedTypeMap,
stderrWriteLock: &logger.stderrWriteLock,
}
if logConfig.Types["userinput"] || logConfig.Types["useroutput"] || (logConfig.Types["*"] && !(logConfig.ExcludedTypes["userinput"] && logConfig.ExcludedTypes["useroutput"])) {
if typeMap["userinput"] || typeMap["useroutput"] || (typeMap["*"] && !(excludedTypeMap["userinput"] && excludedTypeMap["useroutput"])) {
logger.DumpingRawInOut = true
}
if sLogger.MethodFile.Enabled {
@ -91,12 +113,47 @@ func NewLogger(config []LoggingConfig) (*Logger, error) {
}
// Log logs the given message with the given details.
func (logger *Logger) Log(level LogLevel, logType string, messageParts ...string) {
func (logger *Manager) Log(level Level, logType string, messageParts ...string) {
for _, singleLogger := range logger.loggers {
singleLogger.Log(level, logType, messageParts...)
}
}
// Debug logs the given message as a debug message.
func (logger *Manager) Debug(logType string, messageParts ...string) {
for _, singleLogger := range logger.loggers {
singleLogger.Log(LogDebug, logType, messageParts...)
}
}
// Info logs the given message as an info message.
func (logger *Manager) Info(logType string, messageParts ...string) {
for _, singleLogger := range logger.loggers {
singleLogger.Log(LogInfo, logType, messageParts...)
}
}
// Warning logs the given message as a warning message.
func (logger *Manager) Warning(logType string, messageParts ...string) {
for _, singleLogger := range logger.loggers {
singleLogger.Log(LogWarning, logType, messageParts...)
}
}
// Error logs the given message as an error message.
func (logger *Manager) Error(logType string, messageParts ...string) {
for _, singleLogger := range logger.loggers {
singleLogger.Log(LogError, logType, messageParts...)
}
}
// Fatal logs the given message as an error message, then exits.
func (logger *Manager) Fatal(logType string, messageParts ...string) {
logger.Error(logType, messageParts...)
logger.Error("FATAL", "Fatal error encountered, application exiting")
os.Exit(1)
}
type fileMethod struct {
Enabled bool
Filename string
@ -104,18 +161,18 @@ type fileMethod struct {
Writer *bufio.Writer
}
// SingleLogger represents a single logger instance.
type SingleLogger struct {
// singleLogger represents a single logger instance.
type singleLogger struct {
stderrWriteLock *sync.Mutex
MethodSTDERR bool
MethodFile fileMethod
Level LogLevel
Level Level
Types map[string]bool
ExcludedTypes map[string]bool
}
// Log logs the given message with the given details.
func (logger *SingleLogger) Log(level LogLevel, logType string, messageParts ...string) {
func (logger *singleLogger) Log(level Level, logType string, messageParts ...string) {
// no logging enabled
if !(logger.MethodSTDERR || logger.MethodFile.Enabled) {
return
@ -142,10 +199,10 @@ func (logger *SingleLogger) Log(level LogLevel, logType string, messageParts ...
debug := ansi.ColorFunc("78")
section := ansi.ColorFunc("229")
levelDisplay := logLevelDisplayNames[level]
levelDisplay := LogLevelDisplayNames[level]
if level == LogError {
levelDisplay = alert(levelDisplay)
} else if level == LogWarn {
} else if level == LogWarning {
levelDisplay = warn(levelDisplay)
} else if level == LogInfo {
levelDisplay = info(levelDisplay)
@ -155,7 +212,7 @@ func (logger *SingleLogger) Log(level LogLevel, logType string, messageParts ...
sep := grey(":")
fullStringFormatted := fmt.Sprintf("%s %s %s %s %s %s ", timeGrey(time.Now().UTC().Format("2006-01-02T15:04:05Z")), sep, levelDisplay, sep, section(logType), sep)
fullStringRaw := fmt.Sprintf("%s : %s : %s : ", time.Now().UTC().Format("2006-01-02T15:04:05Z"), logLevelDisplayNames[level], section(logType))
fullStringRaw := fmt.Sprintf("%s : %s : %s : ", time.Now().UTC().Format("2006-01-02T15:04:05Z"), LogLevelDisplayNames[level], section(logType))
for i, p := range messageParts {
fullStringFormatted += p
fullStringRaw += p

View File

@ -24,6 +24,7 @@ import (
"time"
"github.com/DanielOaks/girc-go/ircmsg"
"github.com/DanielOaks/oragono/irc/logger"
"github.com/tidwall/buntdb"
)
@ -102,7 +103,7 @@ type Server struct {
listenerEventActMutex sync.Mutex
listeners map[string]ListenerInterface
listenerUpdateMutex sync.Mutex
logger *Logger
logger *logger.Manager
monitoring map[string][]Client
motdLines []string
name string
@ -137,7 +138,7 @@ type clientConn struct {
}
// NewServer returns a new Oragono server.
func NewServer(configFilename string, config *Config, logger *Logger) (*Server, error) {
func NewServer(configFilename string, config *Config, logger *logger.Manager) (*Server, error) {
casefoldedName, err := Casefold(config.Server.Name)
if err != nil {
return nil, fmt.Errorf("Server name isn't valid [%s]: %s", config.Server.Name, err.Error())
@ -226,7 +227,7 @@ func NewServer(configFilename string, config *Config, logger *Logger) (*Server,
}
// open data store
server.logger.Log(LogDebug, "startup", "Opening datastore")
server.logger.Debug("startup", "Opening datastore")
db, err := buntdb.Open(config.Datastore.Path)
if err != nil {
return nil, fmt.Errorf("Failed to open datastore: %s", err.Error())
@ -237,7 +238,7 @@ func NewServer(configFilename string, config *Config, logger *Logger) (*Server,
err = server.store.View(func(tx *buntdb.Tx) error {
version, _ := tx.Get(keySchemaVersion)
if version != latestDbSchema {
logger.Log(LogError, "startup", "server", fmt.Sprintf("Database must be updated. Expected schema v%s, got v%s.", latestDbSchema, version))
logger.Error("startup", "server", fmt.Sprintf("Database must be updated. Expected schema v%s, got v%s.", latestDbSchema, version))
return errDbOutOfDate
}
return nil
@ -249,12 +250,12 @@ func NewServer(configFilename string, config *Config, logger *Logger) (*Server,
}
// load *lines
server.logger.Log(LogDebug, "startup", "Loading D/Klines")
server.logger.Debug("startup", "Loading D/Klines")
server.loadDLines()
server.loadKLines()
// load password manager
server.logger.Log(LogDebug, "startup", "Loading passwords")
server.logger.Debug("startup", "Loading passwords")
err = server.store.View(func(tx *buntdb.Tx) error {
saltString, err := tx.Get(keySalt)
if err != nil {
@ -274,7 +275,7 @@ func NewServer(configFilename string, config *Config, logger *Logger) (*Server,
return nil, fmt.Errorf("Could not load salt: %s", err.Error())
}
server.logger.Log(LogDebug, "startup", "Loading MOTD")
server.logger.Debug("startup", "Loading MOTD")
if config.Server.MOTD != "" {
file, err := os.Open(config.Server.MOTD)
if err == nil {
@ -320,7 +321,7 @@ func NewServer(configFilename string, config *Config, logger *Logger) (*Server,
// start API if enabled
if server.restAPI.Enabled {
logger.Log(LogInfo, "startup", "server", fmt.Sprintf("%s rest API started on %s.", server.name, server.restAPI.Listen))
logger.Info("startup", "server", fmt.Sprintf("%s rest API started on %s.", server.name, server.restAPI.Listen))
server.startRestAPI()
}
@ -389,7 +390,7 @@ func (server *Server) Shutdown() {
server.clients.ByNickMutex.RUnlock()
if err := server.store.Close(); err != nil {
server.logger.Log(LogError, "shutdown", fmt.Sprintln("Could not close datastore:", err))
server.logger.Error("shutdown", fmt.Sprintln("Could not close datastore:", err))
}
}
@ -406,10 +407,10 @@ func (server *Server) Run() {
done = true
case <-server.rehashSignal:
server.logger.Log(LogInfo, "rehash", "Rehashing due to SIGHUP")
server.logger.Info("rehash", "Rehashing due to SIGHUP")
err := server.rehash()
if err != nil {
server.logger.Log(LogError, "rehash", fmt.Sprintln("Failed to rehash:", err.Error()))
server.logger.Error("rehash", fmt.Sprintln("Failed to rehash:", err.Error()))
}
case conn := <-server.newConns:
@ -461,7 +462,7 @@ func (server *Server) Run() {
continue
}
server.logger.Log(LogDebug, "localconnect-ip", fmt.Sprintf("Client connecting from %v", ipaddr))
server.logger.Debug("localconnect-ip", fmt.Sprintf("Client connecting from %v", ipaddr))
go NewClient(server, conn.Conn, conn.IsTLS)
continue
@ -510,7 +511,7 @@ func (server *Server) createListener(addr string, tlsMap map[string]*tls.Config)
server.listeners[addr] = li
// start listening
server.logger.Log(LogInfo, "listeners", fmt.Sprintf("listening on %s using %s.", addr, tlsString))
server.logger.Info("listeners", fmt.Sprintf("listening on %s using %s.", addr, tlsString))
// setup accept goroutine
go func() {
@ -562,7 +563,7 @@ func (server *Server) createListener(addr string, tlsMap map[string]*tls.Config)
server.listenerUpdateMutex.Unlock()
// print notice
server.logger.Log(LogInfo, "listeners", fmt.Sprintf("updated listener %s using %s.", addr, tlsString))
server.logger.Info("listeners", fmt.Sprintf("updated listener %s using %s.", addr, tlsString))
}
default:
// no events waiting for us, fall-through and continue
@ -578,7 +579,7 @@ func (server *Server) createListener(addr string, tlsMap map[string]*tls.Config)
func (server *Server) wslisten(addr string, tlsMap map[string]*TLSListenConfig) {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" {
server.logger.Log(LogError, "ws", addr, fmt.Sprintf("%s method not allowed", r.Method))
server.logger.Error("ws", addr, fmt.Sprintf("%s method not allowed", r.Method))
return
}
@ -591,7 +592,7 @@ func (server *Server) wslisten(addr string, tlsMap map[string]*TLSListenConfig)
ws, err := upgrader.Upgrade(w, r, nil)
if err != nil {
server.logger.Log(LogError, "ws", addr, fmt.Sprintf("%s websocket upgrade error: %s", server.name, err))
server.logger.Error("ws", addr, fmt.Sprintf("%s websocket upgrade error: %s", server.name, err))
return
}
@ -609,7 +610,7 @@ func (server *Server) wslisten(addr string, tlsMap map[string]*TLSListenConfig)
if listenTLS {
tlsString = "TLS"
}
server.logger.Log(LogInfo, "listeners", fmt.Sprintf("websocket listening on %s using %s.", addr, tlsString))
server.logger.Info("listeners", fmt.Sprintf("websocket listening on %s using %s.", addr, tlsString))
if listenTLS {
err = http.ListenAndServeTLS(addr, config.Cert, config.Key, nil)
@ -617,7 +618,7 @@ func (server *Server) wslisten(addr string, tlsMap map[string]*TLSListenConfig)
err = http.ListenAndServe(addr, nil)
}
if err != nil {
server.logger.Log(LogError, "listeners", fmt.Sprintf("listenAndServe error [%s]: %s", tlsString, err))
server.logger.Error("listeners", fmt.Sprintf("listenAndServe error [%s]: %s", tlsString, err))
}
}()
}
@ -651,7 +652,7 @@ func (server *Server) tryRegister(c *Client) {
}
// continue registration
server.logger.Log(LogDebug, "localconnect", fmt.Sprintf("Client registered [%s]", c.nick))
server.logger.Debug("localconnect", fmt.Sprintf("Client registered [%s]", c.nick))
c.Register()
// send welcome text
@ -1241,13 +1242,13 @@ func operHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
// rehash reloads the config and applies the changes from the config file.
func (server *Server) rehash() error {
server.logger.Log(LogDebug, "rehash", "Starting rehash")
server.logger.Debug("rehash", "Starting rehash")
// only let one REHASH go on at a time
server.rehashMutex.Lock()
defer server.rehashMutex.Unlock()
server.logger.Log(LogDebug, "rehash", "Got rehash lock")
server.logger.Debug("rehash", "Got rehash lock")
config, err := LoadConfig(server.configFilename)
@ -1326,7 +1327,7 @@ func (server *Server) rehash() error {
// STS
stsValue := config.Server.STS.Value()
var stsDisabled bool
server.logger.Log(LogDebug, "rehash", "STS Vals", CapValues[STS], stsValue, fmt.Sprintf("server[%v] config[%v]", server.stsEnabled, config.Server.STS.Enabled))
server.logger.Debug("rehash", "STS Vals", CapValues[STS], stsValue, fmt.Sprintf("server[%v] config[%v]", server.stsEnabled, config.Server.STS.Enabled))
if config.Server.STS.Enabled && !server.stsEnabled {
// enabling STS
SupportedCapabilities[STS] = true
@ -1351,7 +1352,7 @@ func (server *Server) rehash() error {
// updated caps get DEL'd and then NEW'd
// so, we can just add updated ones to both removed and added lists here and they'll be correctly handled
server.logger.Log(LogDebug, "rehash", "Updated Caps", updatedCaps.String(Cap301), strconv.Itoa(len(updatedCaps)))
server.logger.Debug("rehash", "Updated Caps", updatedCaps.String(Cap301), strconv.Itoa(len(updatedCaps)))
if len(updatedCaps) > 0 {
for capab := range updatedCaps {
addedCaps[capab] = true
@ -1470,13 +1471,13 @@ func (server *Server) rehash() error {
// REHASH
func rehashHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
server.logger.Log(LogInfo, "rehash", fmt.Sprintf("REHASH command used by %s", client.nick))
server.logger.Info("rehash", fmt.Sprintf("REHASH command used by %s", client.nick))
err := server.rehash()
if err == nil {
client.Send(nil, server.name, RPL_REHASHING, client.nick, "ircd.yaml", "Rehashing")
} else {
server.logger.Log(LogError, "rehash", fmt.Sprintln("Failed to rehash:", err.Error()))
server.logger.Error("rehash", fmt.Sprintln("Failed to rehash:", err.Error()))
client.Send(nil, server.name, ERR_UNKNOWNERROR, client.nick, "REHASH", err.Error())
}
return false

View File

@ -13,6 +13,7 @@ import (
"time"
"github.com/DanielOaks/oragono/irc"
"github.com/DanielOaks/oragono/irc/logger"
"github.com/DanielOaks/oragono/mkcerts"
"github.com/docopt/docopt-go"
"golang.org/x/crypto/ssh/terminal"
@ -43,7 +44,20 @@ Options:
log.Fatal("Config file did not load successfully:", err.Error())
}
logger, err := irc.NewLogger(config.Logging)
// assemble separate log configs
var logConfigs []logger.Config
for _, lConfig := range config.Logging {
logConfigs = append(logConfigs, logger.Config{
MethodStderr: lConfig.MethodStderr,
MethodFile: lConfig.MethodFile,
Filename: lConfig.Filename,
Level: lConfig.Level,
Types: lConfig.Types,
ExcludedTypes: lConfig.ExcludedTypes,
})
}
logger, err := logger.NewManager(logConfigs...)
if err != nil {
log.Fatal("Logger did not load successfully:", err.Error())
}
@ -91,16 +105,16 @@ Options:
} else if arguments["run"].(bool) {
rand.Seed(time.Now().UTC().UnixNano())
if !arguments["--quiet"].(bool) {
logger.Log(irc.LogInfo, "startup", fmt.Sprintf("Oragono v%s starting", irc.SemVer))
logger.Info("startup", fmt.Sprintf("Oragono v%s starting", irc.SemVer))
}
server, err := irc.NewServer(configfile, config, logger)
if err != nil {
logger.Log(irc.LogError, "startup", fmt.Sprintf("Could not load server: %s", err.Error()))
logger.Error("startup", fmt.Sprintf("Could not load server: %s", err.Error()))
return
}
if !arguments["--quiet"].(bool) {
logger.Log(irc.LogInfo, "startup", "Server running")
defer logger.Log(irc.LogInfo, "shutdown", fmt.Sprintf("Oragono v%s exiting", irc.SemVer))
logger.Info("startup", "Server running")
defer logger.Info("shutdown", fmt.Sprintf("Oragono v%s exiting", irc.SemVer))
}
server.Run()
}