From e9e7b5058f786eb479e7e02b01388a877d87b2d6 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Mon, 9 Jul 2018 00:46:28 +0200 Subject: [PATCH] Add missing warning functions --- log/log.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/log/log.go b/log/log.go index 2def0dd..eb010e1 100644 --- a/log/log.go +++ b/log/log.go @@ -36,6 +36,16 @@ func Infof(ctx context.Context, format string, args ...interface{}) { withFields(contextFields(ctx)).Infof(format, args...) } +// Warn prints an warning message with given fields attached. +func Warn(ctx context.Context, msg string, fields ...F) { + withFields(mergeFields(ctx, fields)).Warn(msg) +} + +// Warnf prints a formatted warning message. +func Warnf(ctx context.Context, format string, args ...interface{}) { + withFields(contextFields(ctx)).Warnf(format, args...) +} + // Error prints an error message with given fields attached. func Error(ctx context.Context, msg string, fields ...F) { withFields(mergeFields(ctx, fields)).Error(msg)