improving Godoc

This commit is contained in:
Julien Neuhart
2018-03-28 22:08:36 +02:00
parent d9a09dc795
commit 2f97a44bed
4 changed files with 45 additions and 16 deletions

View File

@@ -39,18 +39,21 @@ func SetLevel(logLevel string) {
}
}
// InfoR logs an information with a transaction field.
func InfoR(transactionID string, msg string) {
Log.WithFields(logrus.Fields{
"transaction": transactionID,
}).Info(msg)
}
// WarnR logs a warning with a transaction field.
func WarnR(transactionID string, msg string) {
Log.WithFields(logrus.Fields{
"transaction": transactionID,
}).Warn(msg)
}
// ErrorR logs an error with transaction, err and code fields.
func ErrorR(transactionID string, err error, code int, msg string) {
Log.WithFields(logrus.Fields{
"transaction": transactionID,