One, logging module
Idle to have no matter, think logging module compare have empty, probably tidy up a bit
Second, the composition of the logging module
Logging module, go inside you will see three packages: Init file, Config,handler
Handler is to deal with some of the content of handler, if you want to make some changes handler can look at this part:
Rotatinghandler (file rotation, file reached the specified size can be changed file)
Timeroatingfilehandler (time file rotation, estimated to be time-based)
。。。。。
Config basically is the processing configuration, we are simple to use, direct simple look at the init file is enough
Three, simple analysis of logging module:
1, some error levels and corresponding numbers, as well as some methods about the log level
2, Logger important class:
Filter: Filters, filter the relevant data, see if you want to record
Handler: Dispatcher, log-related handling of the distribution of class log events
Logger Log object, which represents a channel for logging
Formatter format class, controlling the style of the log output
Third, the composition of logging:
1, loggers
2, Handler
3, Filters
4, formatters
Iv. Configuration of logging
1, simple configuration, the default logger object root
2. Code Configuration
3. File configuration
4.
Python's logging module