-
Notifications
You must be signed in to change notification settings - Fork 510
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
Add utils for logging to the command line #131
Conversation
6cb7c10
to
5aeb613
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool PR @clrcrl! How would you feel about adding a log_info
macro that just goes ahead and invokes:
{{ log(dbt_utils.pretty_output_msg(<the message>), info=True) }}
It seems like this is the intended use-case anyway, right?
README.md
Outdated
|
||
``` | ||
11:07:28 | 1 of 1 START table model analytics.fct_orders........................ [RUN] | ||
+ 11:07:31 | my pretty message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I saw this PR, I imagined the output would instead look like:
11:07:31 + my pretty message
What's the motivation behind placing the timestamp on the right side of the divider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so I was largely following the pattern from here (and in fact means to swap that code out).
I like having it indented as it makes it clear that it's being called from within a model (to me at least). But happy to change it if you feel it's unintuitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I'd go ahead and swap it around I think unless you feel strongly that it should work the way you've already implemented
Yah can for sure add a Is the naming okay? I took inspiration from |
I'd maybe just consider changing |
d0b35ea
to
01d77f7
Compare
01d77f7
to
1c109a4
Compare
1c109a4
to
d559a3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I thought about how to test this, but it gets pretty hard given the output depends on the clock time. I wanted to do a regex match on the output, but Jinja doesn't support this.
In the end, I thought it would just be easiest to test if the output is a string 🙂