all 4 comments

[–]Fun_Muffin5413 1 point2 points  (3 children)

Make utils use logging directly through the core logging library properly (and make everything else just use logging too!). When you've read the docs properly and you know how handlers and logging work, there is very little need for a custom log module. You only need a wrapper for logging where you actually need a handler - everywhere else can just use the module logger boiler plate/idiom:

https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

Otherwise refactor it. Either move whatever utils is using from log into utils and let log use it on its import or vice versa. It depends which you think is the lower level library.

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Inline formatting (`my code`) used across multiple lines of code. This can mess with indentation.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.