File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -746,6 +746,8 @@ func (rb *redirectBuffer) Write(bytes []byte) (n int, err error) {
746
746
747
747
// SetOutput sets the output destination for all severities
748
748
func SetOutput (w io.Writer ) {
749
+ logging .mu .Lock ()
750
+ defer logging .mu .Unlock ()
749
751
for s := fatalLog ; s >= infoLog ; s -- {
750
752
rb := & redirectBuffer {
751
753
w : w ,
@@ -756,6 +758,8 @@ func SetOutput(w io.Writer) {
756
758
757
759
// SetOutputBySeverity sets the output destination for specific severity
758
760
func SetOutputBySeverity (name string , w io.Writer ) {
761
+ logging .mu .Lock ()
762
+ defer logging .mu .Unlock ()
759
763
sev , ok := severityByName (name )
760
764
if ! ok {
761
765
panic (fmt .Sprintf ("SetOutputBySeverity(%q): unrecognized severity name" , name ))
You can’t perform that action at this time.
0 commit comments