0

Logging Python

What is the "name" function of the logging library for in python?

4th Apr 2023, 12:45 PM
Giovanni Paolo Balestriere
Giovanni Paolo Balestriere - avatar
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
4th Apr 2023, 1:33 PM
Tibor Santa
Tibor Santa - avatar
+ 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 :)
4th Apr 2023, 1:28 PM
Apollo-Roboto
Apollo-Roboto - avatar