1
0
Fork 0

Add missing warning functions

This commit is contained in:
Gregory Eremin 2018-07-09 00:46:28 +02:00
parent e40d7a236c
commit e9e7b5058f
1 changed files with 10 additions and 0 deletions

View File

@ -36,6 +36,16 @@ func Infof(ctx context.Context, format string, args ...interface{}) {
withFields(contextFields(ctx)).Infof(format, args...) 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. // Error prints an error message with given fields attached.
func Error(ctx context.Context, msg string, fields ...F) { func Error(ctx context.Context, msg string, fields ...F) {
withFields(mergeFields(ctx, fields)).Error(msg) withFields(mergeFields(ctx, fields)).Error(msg)