Fix: make log api unblocked

This commit is contained in:
Dreamacro
2022-04-25 23:22:58 +08:00
parent 6a92c6af4e
commit aef4dd3fe7
2 changed files with 19 additions and 7 deletions

View File

@ -74,7 +74,7 @@ func SetLevel(newLevel LogLevel) {
level = newLevel
}
func print(data *Event) {
func print(data Event) {
if data.LogLevel < level {
return
}
@ -91,8 +91,8 @@ func print(data *Event) {
}
}
func newLog(logLevel LogLevel, format string, v ...any) *Event {
return &Event{
func newLog(logLevel LogLevel, format string, v ...any) Event {
return Event{
LogLevel: logLevel,
Payload: fmt.Sprintf(format, v...),
}