From 4fd274e0b89fc534389779eace39e4da3c1de6f8 Mon Sep 17 00:00:00 2001 From: David Bariod Date: Mon, 28 Oct 2019 19:22:23 +0100 Subject: [PATCH] improve Logger.WithField documentation --- logger.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/logger.go b/logger.go index c0c0b1e..b827e44 100644 --- a/logger.go +++ b/logger.go @@ -100,8 +100,9 @@ func (logger *Logger) releaseEntry(entry *Entry) { logger.entryPool.Put(entry) } -// Adds a field to the log entry, note that it doesn't log until you call -// Debug, Print, Info, Warn, Error, Fatal or Panic. It only creates a log entry. +// WithField allocates a new entry and adds a field to it. +// Debug, Print, Info, Warn, Error, Fatal or Panic must be then applied to +// this new returned entry. // If you want multiple fields, use `WithFields`. func (logger *Logger) WithField(key string, value interface{}) *Entry { entry := logger.newEntry()