Skip to content

Commit 53dcb74

Browse files
committed
Log closure of logging for debugging purposes
1 parent c3969f3 commit 53dcb74

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

internal/logging/file.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ func (l *fileHandler) Close() {
151151
return
152152
}
153153

154+
l.Emit(getContext("DEBUG", 1), "Closing logging handler")
155+
154156
close(l.quit)
155157
l.wg.Wait()
156158

internal/logging/logging.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ const (
3838
WARNING = 4
3939
WARN = 4
4040
ERROR = 8
41-
NOTICE = 16 //notice is like info but for really important stuff ;)
41+
NOTICE = 16 // notice is like info but for really important stuff ;)
4242
CRITICAL = 32
43-
QUIET = ERROR | NOTICE | CRITICAL //setting for errors only
43+
QUIET = ERROR | NOTICE | CRITICAL // setting for errors only
4444
NORMAL = INFO | WARN | ERROR | NOTICE | CRITICAL // default setting - all besides debug
4545
ALL = 255
4646
NOTHING = 0
@@ -158,7 +158,9 @@ func (l *standardHandler) Printf(msg string, args ...interface{}) {
158158
l.Emit(getContext("DBG", 1), logMsg, args...)
159159
}
160160

161-
func (l *standardHandler) Close() {}
161+
func (l *standardHandler) Close() {
162+
l.Emit(getContext("DEBUG", 1), "Closing logging handler")
163+
}
162164

163165
var currentHandler LoggingHandler = &standardHandler{
164166
DefaultFormatter,

0 commit comments

Comments
 (0)