- add Formatter.JSONEscapeHTML and SetJSONEscapeHTML to let JSON writers preserve HTML-sensitive characters when needed while keeping escaping enabled by default. - switch JSON output to json.Encoder, preserve existing Print/Println newline semantics, and cover the new escaping behavior in tests.
This commit is contained in:
@@ -32,6 +32,7 @@ func main() {
|
||||
jsonFormatter := sneklog.NewFormatter().
|
||||
SetFormat("[%L] [%N] %m").
|
||||
SetColorOutput(false).
|
||||
SetJSONEscapeHTML(false).
|
||||
SetTimeStampFormat(sneklog.Kitchen)
|
||||
|
||||
textStdout.SetFormatter(formatter)
|
||||
@@ -62,6 +63,7 @@ func main() {
|
||||
externalJSON,
|
||||
)
|
||||
|
||||
logger.Infoln("Тест <>&")
|
||||
logger.Infoln("service started")
|
||||
logger.Warnln("cache miss")
|
||||
logger.Errorln("request failed")
|
||||
|
||||
Reference in New Issue
Block a user