Skip to content

Commit

Permalink
Merge pull request #85 from thockin/master
Browse files Browse the repository at this point in the history
funcr: Add Formatter.GetDepth()
  • Loading branch information
pohly committed Aug 23, 2021
2 parents 31ff767 + 47dc3d3 commit c908498
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions funcr/funcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@ func (f Formatter) Enabled(level int) bool {
return level <= f.verbosity
}

// GetDepth returns the current depth of this Formatter. This is useful for
// implementations which do their own caller attribution.
func (f Formatter) GetDepth() int {
return f.depth
}

// FormatInfo flattens an Info log message into strings.
// The prefix will be empty when no names were set.
func (f Formatter) FormatInfo(level int, msg string, kvList []interface{}) (prefix, argsStr string) {
Expand Down

0 comments on commit c908498

Please sign in to comment.