mheberger / delineator

Fast, accurate watershed delineation using hybrid vector- and raster-based methods and data from MERIT-Hydro
MIT License
86 stars 21 forks source link

Improve logging #10

Open mmaelicke opened 3 weeks ago

mmaelicke commented 3 weeks ago

Hi @mheberger,

Before I open another PR, I wanted to propose a change: What to you think of replacing the print statements with a logging.Logger? The VERBOSE setting could then be used to pre-configure the level of the logger, so if the user sets VERBOSE to false nothing would be printed. The huge advantage would be that the output could be more fine-grained using debug, info and warning log messages. Secondly, and for me more importantly, I could easily replace the default logger with another instance that formats log messages as I need them.

I would be willing to do the implementation, but wanted to make sure that you are interested and like it, because it's more work than my last PR.

Best, Mirko

mheberger commented 3 weeks ago

This seems to be a good idea. If you are motivated to do it, go for it!

On Sun, Oct 27, 2024 at 8:04 AM Mirko Mälicke @.***> wrote:

Hi @mheberger https://github.com/mheberger,

Before I open another PR, I wanted to propose a change: What to you think of replacing the print statements with a logging.Logger? The VERBOSE setting could then be used to pre-configure the level of the logger, so if the user sets VERBOSE to false nothing would be printed. The huge advantage would be that the output could be more fine-grained using debug, info and warning log messages. Secondly, and for me more importantly, I could easily replace the default logger with another instance that formats log messages as I need them.

I would be willing to do the implementation, but wanted to make sure that you are interested and like it, because it's more work than my last PR.

Best, Mirko

— Reply to this email directly, view it on GitHub https://github.com/mheberger/delineator/issues/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYEMR6ASO4AQXVYQRFLZDDZ5TXFPAVCNFSM6AAAAABQV4XOMCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYTMNRWGA3TKMQ . You are receiving this because you were mentioned.Message ID: @.***>