Skip to content

Commit 329d0e9

Browse files
committed
log: support to set output
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
1 parent 909c7de commit 329d0e9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

context.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ package log
4040
import (
4141
"context"
4242
"fmt"
43+
"io"
4344

4445
"github.com/sirupsen/logrus"
4546
)
@@ -130,6 +131,10 @@ func SetLevel(level string) error {
130131
return nil
131132
}
132133

134+
func SetOutput(out io.Writer) {
135+
L.Logger.SetOutput(out)
136+
}
137+
133138
// GetLevel returns the current log level.
134139
func GetLevel() Level {
135140
return L.Logger.GetLevel()

0 commit comments

Comments
 (0)