How to use 'logging basicconfig' in Python

Every line of 'logging basicconfig' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
1093def basicConfig():
1094 """
1095 Do basic configuration for the logging system by creating a
1096 StreamHandler with a default Formatter and adding it to the
1097 root logger.
1098 """
1099 if len(root.handlers) == 0:
1100 hdlr = StreamHandler()
1101 fmt = Formatter(BASIC_FORMAT)
1102 hdlr.setFormatter(fmt)
1103 root.addHandler(hdlr)
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets