Improved log_contains_error() (#176)