支持配置是否打印到文件

This commit is contained in:
Yun
2024-07-09 15:36:11 +08:00
parent d41516d05d
commit 70699e9701
4 changed files with 58 additions and 21 deletions
+23
View File
@@ -0,0 +1,23 @@
package main
import (
"context"
"github.com/yuninks/loggerx"
)
func main() {
ctx := context.Background()
log := loggerx.NewLogger(ctx,
// loggerx.SetPrintFile(false),
loggerx.SetToConsole(),
)
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
}