Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info vs debug text formatting #4418

Merged
merged 1 commit into from
Dec 3, 2021
Merged

Info vs debug text formatting #4418

merged 1 commit into from
Dec 3, 2021

Conversation

jtcohen6
Copy link
Contributor

@jtcohen6 jtcohen6 commented Dec 3, 2021

cosmetic only!

One last bit of parity with the old logger: When the --debug flag is provided, and text-formatted logs are used, I think that should mean both:

  • Print debug-level messages to stdout
  • Use "debug" formatting, i.e. include longer timestamp + thread name

In this sense, the operative distinction is less CLI vs. File, and more Info vs. Debug style of text formatting. This lets the user see the exact same thing in logs/dbt.log and in stdout when they pass the --debug flag

Legacy

$ dbt --debug run
2021-12-03 13:00:23.366679 (MainThread): Running with dbt=0.21.1
2021-12-03 13:00:23.463368 (MainThread): running dbt with arguments Namespace(cls=<class 'dbt.task.run.RunTask'>, debug=True, defer=None, exclude=None, fail_fast=False, full_refresh=False, log_cache_events=False, log_format='default', partial_parse=None, profile=None, profiles_dir='/Users/jerco/.dbt', project_dir=None, record_timing_info=None, rpc_method='run', select=None, selector_name=None, single_threaded=False, state=None, strict=False, target=None, test_new_parser=False, threads=None, use_cache=True, use_colors=None, use_experimental_parser=False, vars='{}', version_check=True, warn_error=False, which='run', write_json=True)

Before (current)

$ dbt --debug run
13:01:19  Running with dbt=1.0.0-rc3
13:01:19  running dbt with arguments Namespace(cls=<class 'dbt.task.run.RunTask'>, debug=True, defer=None, exclude=None, fail_fast=None, full_refresh=False, log_cache_events=False, log_format=None, partial_parse=None, printer_width=None, profile=None, profiles_dir='/Users/jerco/.dbt', project_dir=None, record_timing_info=None, rpc_method='run', select=None, selector_name=None, send_anonymous_usage_stats=None, single_threaded=False, state=None, static_parser=None, target=None, threads=None, use_colors=None, use_experimental_parser=None, vars='{}', version_check=None, warn_error=None, which='run', write_json=None)

After (this change)

$ dbt --debug run


============================== 2021-12-03 13:00:54.558606 | 31ffd57a-af02-4834-86ee-51202abb8832 ==============================
13:00:54.558606 [info ] [MainThread]: Running with dbt=1.0.0-rc3
13:00:54.559303 [debug] [MainThread]: running dbt with arguments Namespace(cls=<class 'dbt.task.run.RunTask'>, debug=True, defer=None, exclude=None, fail_fast=None, full_refresh=False, log_cache_events=False, log_format=None, partial_parse=None, printer_width=None, profile=None, profiles_dir='/Users/jerco/.dbt', project_dir=None, record_timing_info=None, rpc_method='run', select=None, selector_name=None, send_anonymous_usage_stats=None, single_threaded=False, state=None, static_parser=None, target=None, threads=None, use_colors=None, use_experimental_parser=None, vars='{}', version_check=None, warn_error=None, which='run', write_json=None)

I don't mind the separator :)

@cla-bot cla-bot bot added the cla:yes label Dec 3, 2021
@jtcohen6 jtcohen6 requested review from nathaniel-may and removed request for gshank December 3, 2021 13:04
@jtcohen6 jtcohen6 merged commit 6855fe0 into main Dec 3, 2021
@jtcohen6 jtcohen6 deleted the debug-formatting-when-debug branch December 3, 2021 13:36
leahwicz pushed a commit that referenced this pull request Dec 3, 2021
leahwicz added a commit that referenced this pull request Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants