Logging - Intermediate Python Programming p.22

Channel:
Subscribers:
1,410,000
Published on ● Video Link: https://www.youtube.com/watch?v=-RcDmGNSuvU



Category:
Vlog
Duration: 15:00
18,902 views
247


Welcome to part 22 of the intermediate Python programming tutorial series. We're going to be covering logging in Python .

The idea of Python's logging module is to make your life easier. Have you ever maybe added print functions/statements in your code at various places to note where your code is and what's running? Then maybe commented it out? Maybe you got fancy and created a constant like debug = True, then had some lines like if debug: print(something). If this sounds like you, or if it sounds like something that you might find useful, chances are, you should be using logging instead. Maybe you haven't yet needed to do such things, but, eventually you may find yourself in a situation where you do want to temporarily track what your code is doing, but not always. Using print can help in a pinch, but your life will be easier in the long run if you bake logging into your code early on. With logging, you can both output to console as well as saving to a file, all depending on varying debugging levels you can choose from.

https://pythonprogramming.net
https://twitter.com/sentdex
https://www.facebook.com/pythonprogramming.net/
https://plus.google.com/+sentdex







Tags:
logging
debug
debugging
python
python 3
tutorial
intermediate
introduction
programming
Object Oriented Programming
Class
OOP