Add connectionID to as many entries as possible

Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be>
This commit is contained in:
Jo Vandeginste
2019-09-05 16:21:35 +02:00
committed by drakkan
parent 53d70b68d8
commit 0737c672f5
20 changed files with 156 additions and 156 deletions

View File

@@ -59,23 +59,23 @@ func InitLogger(logFilePath string, logMaxSize int, logMaxBackups int, logMaxAge
}
// Debug logs at debug level for the specified sender
func Debug(sender string, format string, v ...interface{}) {
logger.Debug().Str("sender", sender).Msg(fmt.Sprintf(format, v...))
func Debug(sender string, connectionID string, format string, v ...interface{}) {
logger.Debug().Str("sender", sender).Str("connection_id", connectionID).Msg(fmt.Sprintf(format, v...))
}
// Info logs at info level for the specified sender
func Info(sender string, format string, v ...interface{}) {
logger.Info().Str("sender", sender).Msg(fmt.Sprintf(format, v...))
func Info(sender string, connectionID string, format string, v ...interface{}) {
logger.Info().Str("sender", sender).Str("connection_id", connectionID).Msg(fmt.Sprintf(format, v...))
}
// Warn logs at warn level for the specified sender
func Warn(sender string, format string, v ...interface{}) {
logger.Warn().Str("sender", sender).Msg(fmt.Sprintf(format, v...))
func Warn(sender string, connectionID string, format string, v ...interface{}) {
logger.Warn().Str("sender", sender).Str("connection_id", connectionID).Msg(fmt.Sprintf(format, v...))
}
// Error logs at error level for the specified sender
func Error(sender string, format string, v ...interface{}) {
logger.Error().Str("sender", sender).Msg(fmt.Sprintf(format, v...))
func Error(sender string, connectionID string, format string, v ...interface{}) {
logger.Error().Str("sender", sender).Str("connection_id", connectionID).Msg(fmt.Sprintf(format, v...))
}
// DebugToConsole logs at debug level to stdout