We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab4d90c commit 959d342Copy full SHA for 959d342
1 file changed
klog.go
@@ -746,6 +746,8 @@ func (rb *redirectBuffer) Write(bytes []byte) (n int, err error) {
746
747
// SetOutput sets the output destination for all severities
748
func SetOutput(w io.Writer) {
749
+ logging.mu.Lock()
750
+ defer logging.mu.Unlock()
751
for s := fatalLog; s >= infoLog; s-- {
752
rb := &redirectBuffer{
753
w: w,
@@ -756,6 +758,8 @@ func SetOutput(w io.Writer) {
756
758
757
759
// SetOutputBySeverity sets the output destination for specific severity
760
func SetOutputBySeverity(name string, w io.Writer) {
761
762
763
sev, ok := severityByName(name)
764
if !ok {
765
panic(fmt.Sprintf("SetOutputBySeverity(%q): unrecognized severity name", name))
0 commit comments