bugfix: log_error function is nil when ERR defined