This article introduces the logging module-level functions of the python log module.
Logging. getLogger ([name]): returns a logger object. If no name is specified, the root logger is returned.
Logging. debug (), logging.info (), logging. warning (),
The python module learns logging and the python module logging.
1. Simply print logs to the screen
Import logginglogging. debug ('this is debug message') logging.info ('this is info message') logging. warning ('this is warning message'): WARNING:
For Python, there have been two problems that have plagued me these days:There is no way to get the current line number and function name directly in 1.python. This is a question raised in the Forum, a group of people are just guessing why Python
For Python, there are two problems that have plagued me these days:
There is no way to get the current line number and function name directly in 1.python. This is a question raised in the forum, and the bottom group is just guessing why Python does
For python, two problems have plagued me over the past few days:1. The current row number and function name cannot be obtained directly in python. This is a question raised by someone in the forum. the people below are just wondering why python does
SYS moduleSYS.ARGV command line argument list, the first element is the program itself path Sys.exit (n) exits the program, exit normally (0)Sys.path Returns the search path for the module, using the value of the
All TCP/IP tuning parameters are located in the/proc/sys/net/directory. For example, here are some of the most important tuning parameters, followed by their meanings: 1,/proc/sys/net/core/rmem_max -the largest TCP data receive
OS ModuleOS.GETCWD () Gets the current working directory, that is, the directory path of the current Python script work os.chdir ("DirName") changes the current script working directory, equivalent to the shell Cdos.curdir return the current
One, logging moduleImport logginglogging.debug ('This isdebug message') logging.info (' This is info message ' ) logging.warning ('This waswarning message' is Warning messageBy default, logging prints the log to the screen with a log level of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.