Fix `NameError` on logging message.