Skip to content

Commit f34ac90

Browse files
committed
feat(notifications): add
1 parent 3bbbe7e commit f34ac90

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

log/log.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ func Panicf(format string, v ...interface{}) {
135135
Panic(fmt.Sprintf(format, v...))
136136
}
137137

138+
// AddHook adds hook to the logger
139+
func AddHook(hook Hook) {
140+
logger.Hooks = append(logger.Hooks, hook)
141+
}
142+
143+
// EmptyHooks empties the hooks of the logger
144+
func EmptyHooks(hook Hook) {
145+
logger.Hooks = []Hook{}
146+
}
147+
138148
func (li *MetaInfo) log() {
139149
nowStr := time.Now().Format(timeFormat)
140150
switch li.Lvl {

0 commit comments

Comments
 (0)