允许配置json是否转义

This commit is contained in:
Yun
2025-01-15 15:29:45 +08:00
parent 33706c1072
commit fad8686a73
3 changed files with 29 additions and 8 deletions
+7 -6
View File
@@ -14,15 +14,16 @@ func main() {
loggerx.SetToConsole(),
// loggerx.SetTimeZone(time.UTC),
loggerx.SetTimeZone(time.FixedZone("CST", 8*3600)),
loggerx.SetEscapeHTML(false),
)
log.WriteAsync().Info(ctx, "哈哈哈2异步")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.WriteAsync().Info(ctx, "{ \"a\": 1, \"b\": 2 }")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2")
log.Info(ctx, "哈哈哈2\r")
log.Info(ctx, "哈哈哈2\r\n")
log.Info(ctx, "哈哈哈2<b>")
log.Info(ctx, "哈哈哈2<")
log.Info(ctx, "哈哈哈2>")
for i := 0; i < 100; i++ {
log.WriteAsync().Infof(ctx, "异步 %d", i)