From 5f8c666a13e837e7d5ecc20a7ae6cd6d1581ebcb Mon Sep 17 00:00:00 2001 From: David Bariod Date: Sun, 12 Sep 2021 15:14:05 +0200 Subject: [PATCH] Improve Log methods documentation --- entry.go | 3 +++ logger.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/entry.go b/entry.go index 0a5a8326..03550974 100644 --- a/entry.go +++ b/entry.go @@ -296,6 +296,9 @@ func (entry *Entry) write() { } } +// Log will log a message at the level given as parameter. +// Warning: using Log at Panic or Fatal level will not respectively Panic nor Exit. +// For this behaviour Entry.Panic or Entry.Fatal should be used instead. func (entry *Entry) Log(level Level, args ...interface{}) { if entry.Logger.IsLevelEnabled(level) { entry.log(level, fmt.Sprint(args...)) diff --git a/logger.go b/logger.go index 91b460e0..5ff0aef6 100644 --- a/logger.go +++ b/logger.go @@ -195,6 +195,9 @@ func (logger *Logger) Panicf(format string, args ...interface{}) { logger.Logf(PanicLevel, format, args...) } +// Log will log a message at the level given as parameter. +// Warning: using Log at Panic or Fatal level will not respectively Panic nor Exit. +// For this behaviour Logger.Panic or Logger.Fatal should be used instead. func (logger *Logger) Log(level Level, args ...interface{}) { if logger.IsLevelEnabled(level) { entry := logger.newEntry()