optimized log_error