Skip to content

Commit

Permalink
Merge pull request #1283 from sirupsen/dbd-log-doc
Browse files Browse the repository at this point in the history
Improve Log methods documentation
  • Loading branch information
dgsb authored Sep 12, 2021
2 parents 5418b6e + 5f8c666 commit 79c5ab6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...))
Expand Down
3 changes: 3 additions & 0 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 79c5ab6

Please sign in to comment.