#100DaysOfCode in Python Transcripts
Chapter: Days 31-33: Logging
Lecture: Logging with Logbook

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Python has built in log in and you can do log in without any external dependencies. But I would like to introduce you to
0:08 this concept to this package logbook. Now this as you can see here replaces Python's standard library for logging
0:17 and it does so in a way that makes it really easy to work with logs in our application but also super flexible. So for example, we can come over here
0:26 and import the logger and we can just say "I would just like to push all the log messages to standard out", could be a file also for example,
0:34 now we'll create a logbook and then we just log.info, log.trace, log.error, we sort of categorize the response, the message we'll send that way
0:43 and you get something like, well see below but also what you see in stock Python. Why not just use the built in one? Well, this is nice and clean and
0:51 it creates a nice hierarchy, really really cool for when you use it your application. But also it's way more flexible, look at this,
0:59 how about getting a notification to your phone or pushing notifications or something like that under certain log message situations. Really cool.
1:06 So we'll see the logbook is really powerful and it's actually created by Armin Ronacher who is the creator of Flask,
1:14 one of the most popular and well liked Python web frameworks out there.

Talk Python's Mastodon Michael Kennedy's Mastodon