logging module
Both configurations logging module logs the output format:
1、
Output is as follows:
2、
The second way is as follows:
note
logger = logging.getLogger()
No arguments defaults to the root user.
logger1 = logging.getLogger('mylog')
Parameters is to create user
The newly created user is the root user sub-accounts, sub-accounts of the log output delivered to all root accounts Logger process.
Figure root root user opens the screen output, sub-accounts mylog, mylog1 open the screen output is output twice. (MyLog output again, and then passed again processed output root)
Output: