rs / zerolog

Zero Allocation JSON Logger
MIT License
10.33k stars 564 forks source link

logger.UpdateContext checks for disabled logger using equality #643

Open mitar opened 7 months ago

mitar commented 7 months ago

logger.UpdateContext checks for disabled logger:

    if l == disabledLogger {
        return
    }

I think this is problematic as it should check in a more general way, to handle also Nop and zero values. In my tests I found race conditions because I was reusing same global nop-logger. I think a better check would be something like it was done in #617. Do you agree? I can make a PR.