IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

feat: use module names for loggers #136

Closed datawookie closed 2 years ago

datawookie commented 2 years ago

Hi!

We've been using this package for around a year now and have really enjoyed how simple it makes submitting queries to the Watson API.

However, we'd like to be able to control the level of logging produced by the library. At present this is difficult since all of the modules what use logging do it via the root logger (so it's impossible to pin-point just what we are turning off).

In this MR I have used the module name for each module that employs logging. This means that clients using the package can now selecting turn logging on or off for this package. This is the behaviour that is implemented in many popular Python packages like requests.

Thanks, Andrew.

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

padamstx commented 2 years ago

@datawookie Andrew, thank you for the PR! We'll get this reviewed and let you know about any feedback, etc.

@rmkeezer @pyrooka Hey guys, this seems to be a pretty straightforward PR. Can you give it a look to make sure I didn't miss anything? :)

padamstx commented 2 years ago

@datawookie Andrew, one question... given these changes, can you briefly describe how one would turn on or off the logging for a specific logger/module? Thanks

datawookie commented 2 years ago

Hi @pyrooka, I'm all about conventions, so very happy to apply those changes. Thank you!

padamstx commented 2 years ago

@datawookie With your latest changes, the build is now failing during the unti test execution due to some sort of indentation issue. Are you able to build/test cleanly in your local sandbox? i.e. try this in the root of the project:

make ci

(this is the same command that is run during the Travis build)

Edit: I recommend that you use a virtualenv to avoid polluting your machine with dependencies from this project :)

datawookie commented 2 years ago

Hi @pyrooka, ah, crap. No problem. I applied the changes locally and then force pushed. Also changed my commit messages to use conventional commits. Hope that this is all good now. Thanks, Andrew.

datawookie commented 2 years ago

Hi @pyrooka, I've moved the code. Thanks, Andrew.

padamstx commented 2 years ago

@datawookie I think all the code changes look good now, but with your last commit it looks like you added the "nohup.out" file inadvertently. Please remove that then update your branch and we can get this PR merged in. Thanks!

datawookie commented 2 years ago

@pyrooka fixed!

ibm-devx-sdk commented 2 years ago

:tada: This PR is included in version 3.14.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: