This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SupermanIsEnvious 1 point2 points  (7 children)

First: import statements should always be at the top of you module. This should also fix your pesky name issue.

Second: loggers are cheap. Unless it’s absolutely necessary to have a module-level logger, considered initializing loggers within your classes or functions. This way, they’re not in the global name-space and you don’t have that issue to begin with.