Coder Social home page Coder Social logo

Comments (5)

Kalebu avatar Kalebu commented on August 17, 2024

Hey @rbarcelos Can you please explain more about the issue with current logging and the your suggestion to fixing it ?

from heyoo.

rbarcelos avatar rbarcelos commented on August 17, 2024

Disclaimer: I just started playing with Python so no guarantees that my guidance is correct..

Looking at your code (iniit.py), given the way that you are setting up logging, it will be called as soon as I import your module. For some reason, calling logging.basicConfig with my configs after that wont update it.

One possible fix: make logging an optional parameter on WhatsApp ctor. So consumers can passe their instance instead of you creating yours. It aligns with the dependency injection pattern

from heyoo.

soerenetler avatar soerenetler commented on August 17, 2024

I tried to look into this a little and find some best practices. https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
I think the library should use _logger = logging.getLogger(__name__) and give the specific configuration to the user.
I could look into it further and create a PR.

from heyoo.

Kalebu avatar Kalebu commented on August 17, 2024

I see
Please proceed @soerenetler

from heyoo.

Kalebu avatar Kalebu commented on August 17, 2024

Resolved by #71

from heyoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.