diff --git a/core/dbt/parser/schemas.py b/core/dbt/parser/schemas.py index b25b050d614..523002e17a9 100644 --- a/core/dbt/parser/schemas.py +++ b/core/dbt/parser/schemas.py @@ -960,10 +960,9 @@ def parse_patch( unique_id = f'macro.{patch.package_name}.{patch.name}' macro = self.manifest.macros.get(unique_id) if not macro: - warn_or_error( - f'WARNING: Found patch for macro "{patch.name}" ' - f'which was not found' - ) + msg = f'Found patch for macro "{patch.name}" ' \ + f'which was not found' + warn_or_error(msg, log_fmt=warning_tag('{}')) return if macro.patch_path: package_name, existing_file_path = macro.patch_path.split('://') diff --git a/core/dbt/task/runnable.py b/core/dbt/task/runnable.py index f8d5e7bbcf1..4d93d564e73 100644 --- a/core/dbt/task/runnable.py +++ b/core/dbt/task/runnable.py @@ -56,6 +56,7 @@ import dbt.exceptions from dbt import flags import dbt.utils +from dbt.ui import warning_tag RESULT_FILE_NAME = 'run_results.json' MANIFEST_FILE_NAME = 'manifest.json' @@ -461,8 +462,9 @@ def run(self): if len(self._flattened_nodes) == 0: with TextOnly(): fire_event(EmptyLine()) - warn_or_error("WARNING: Nothing to do. Try checking your model " - "configs and model specification args") + msg = "Nothing to do. Try checking your model " \ + "configs and model specification args" + warn_or_error(msg, log_fmt=warning_tag('{}')) result = self.get_result( results=[], generated_at=datetime.utcnow(), diff --git a/core/dbt/ui.py b/core/dbt/ui.py index 39d7e03e4ea..176f05d4283 100644 --- a/core/dbt/ui.py +++ b/core/dbt/ui.py @@ -66,6 +66,4 @@ def line_wrap_message( def warning_tag(msg: str) -> str: - # no longer needed, since new logging includes colorized log level - # return f'[{yellow("WARNING")}]: {msg}' - return msg + return f'[{yellow("WARNING")}]: {msg}'