How to temporarily disable/mute logging using Zap logger in Go

39 Views Asked by At

How to temporarily disable logging using Zap logger in Go. I need to mute logs for a particular function without removing logger print statements. I need a solution similar to what we do for fmt as below,

temp := os.Stdout
os.Stdout = nil
fmt.Println("Hello")
os.Stdout = temp
fmt.Println("Bye")
0

There are 0 best solutions below