Logging

import logging
logging.warning('Watch out!') # will print a message to the console
logging.info('I told you so') # will not print anything
import logging
logging.basicConfig(filename='example.log',level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.info('So should this')
logging.warning('And this, too')

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Modern Cloud Native Platform- Cloud Foundry Application Runtime

Java 8 | For Practice

Crodo — Brandpad competitor review

Flutter date format: “just now”, “yesterday”, weekday, …

Developing an SMS web app for broadcasting menu updates to customers of a food delivery startup

Invest Your Golden Time in Transferable Skills

Snapshot testing in Python for Sublime Text packages

Building Tensorflow 2.0 with GPU support and TensorRT on Ubuntu 18.04 LTS [Part 1]

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aidanmc

Aidanmc

More from Medium

How to change Docstrings format in PyCharm and example of automatic input

Https implementation on apache ubuntu with let’s encrypt

Python “lxml” Memory Leak

Connecting docker to mysql