From 329d0e93eb5c2e2498fe75f0b0105a2dc8e6fbdb Mon Sep 17 00:00:00 2001 From: ningmingxiao Date: Tue, 28 Apr 2026 11:19:57 +0800 Subject: [PATCH] log: support to set output Signed-off-by: ningmingxiao --- context.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/context.go b/context.go index 2015306..8e9a04a 100644 --- a/context.go +++ b/context.go @@ -40,6 +40,7 @@ package log import ( "context" "fmt" + "io" "github.com/sirupsen/logrus" ) @@ -130,6 +131,10 @@ func SetLevel(level string) error { return nil } +func SetOutput(out io.Writer) { + L.Logger.SetOutput(out) +} + // GetLevel returns the current log level. func GetLevel() Level { return L.Logger.GetLevel()