2 Antworten
+ 5
The logging library does not have a name() function.
You can check the documentation for reference.
https://docs.python.org/3/library/logging.html
+ 4
It's to name your logger! You'll see this name appear in the logs.
In larger project, it's often useful to see where this log comes from.
You will often see this line:
log = logging.getLogger(__name__)
Where __name__ correspond to the name of the current module.
I hope this helps :)