Skip to content

Commit c426ae3

Browse files
committed
buffer empty check method for default logger
1 parent 86a0863 commit c426ae3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

default.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ func SetPattern(pattern string) error {
138138
return std.SetPattern(pattern)
139139
}
140140

141+
// IsBufferEmpty returns true if logger buffer is empty otherwise false.
142+
// This method can be used to ensure all the log entry is written successfully.
143+
func IsBufferEmpty() bool {
144+
return std.IsBufferEmpty()
145+
}
146+
141147
func init() {
142148
cfg, _ := config.ParseString("log { }")
143149
std, _ = New(cfg)

0 commit comments

Comments
 (0)