Adding a CMS to Your Flask Web App Transcripts
Chapter: Course conclusion
Lecture: Review: logging

Login or purchase this course to watch this video and the rest of the course contents.
0:00 your Web app probably already has some kind of logging and if it doesn't, you should add it. The logging that we reason in our pipi I app and
0:09 that we kept using in our CMS is logbook and low book is really, really nice. It's super easy use it does the rotating bile output with the date
0:19 lost the file name and creates a new one every day. All the kind of stuff you would hope that it would easily dio.
0:25 So we started out working with this and we brought us in to add additional logging
0:29 to our CMS admin side so we could see what was happening there and it was
0:33 really easy. But we also saw that the markdown sub temple library has logging and log reporting and diagnostic information coming out of it.
0:42 So we also want to take the final step to go in. Integrate are logging system in this case, the logbook with markdown sub template.
0:50 So it's all together in one place, and that was incredibly easy. We just wanted to change the level right just going toe, print it out somewhere.
0:57 We want to do that. We just go to logging from the library. We can say long enough. Get log and then log,
1:04 not log. Level equals. We have this new Marais shin log level so we could say error, trace and bo warnings and so on.
1:11 This will just let you control how much comes out of it, but not where it goes. If you want to control where it goes,
1:17 just like the database we create this class that drive from sub template logger in this case and implement a few methods trace,
1:24 invoke and so on and was gonna integrate with logbook. We're gonna create a logbook here.
1:30 And whenever the system asked us to do a trace long as we check that we should do that trace right. Gonna check the level there,
1:37 see what level it's that were to come in and just do the logbook, Walker, trace or log book blogger dot info and just pass it through.
1:45 So this allows us to adapt whatever logging system we're using and capture the output from

Talk Python's Mastodon Michael Kennedy's Mastodon