Snowflake-Labs / schemachange

A Database Change Management tool for Snowflake
Apache License 2.0
515 stars 227 forks source link

Incorporate logging module instead of print function #104

Closed tsingh2k15 closed 3 months ago

tsingh2k15 commented 2 years ago

I wanted to share few of my thoughts and get your thoughts on it.

If any of these suggestions is relevant, I am open to collaborate and contribute on these. Thank you!

sfc-gh-jhansen commented 2 years ago

Hey there @tsingh2k15, so sorry for the slow response here, things have been crazy! The second item doesn't seem as urgent as schemachange already has decent CLI support. But I am curious to hear more about your first item. And in particular I'm curious how it would then integrate with virtually any CI/CD tool like schemachange does now. By printing to the command line the CI/CD tools capture the output and make it easily viewable. How would this work with a logging library instead? (I haven't researched this so I'm curious).

gudata commented 2 years ago

Not sure but I think the idea for the logging is that anyone can easly patch and create loggers / formatters to send the logs where they want (for example remote)

The logger by default could be configured to print to stdout.

Another benefit will that we can set the verbosity - debug, info etc.

sfc-gh-tmathew commented 1 year ago

Hello @tsingh2k15

As you can see that the current release of Schemachange has been rewritten in 3.5, please take a look and see how logger can be incorporated into the code.

Let us discuss how the logger library should be incorporated. I am open standardizing using the logger module but would like to understand the pros and cons if you have already thought about it.

Take a look at the current code base and please share your current thoughts.

cc: @gudata

sfc-gh-tmathew commented 1 year ago

@tsingh2k15 @gudata What logging patterns are you suggesting with logger module?

Would like to group this work along with #209 and #156 if you could give me a few pointers on how you see the logger module incorporated into the latest codebase.

sfc-gh-tmathew commented 3 months ago

As we work on the #275 and its related pieces, we will consider logging with backward compatibility. Please start using 3.7.0 and open new issues to start a new thread.