Adding a CMS to Your Pyramid 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.
0:05
The logging that we reason in our pipi I app and that we kept using in our CMS is logbook and low book is really, really nice.
0:14
It's super easy use it does the rotating bile output with the date lost the file name and creates a new one every day.
0:22
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 to our CMS admin side so we could see what was happening there and it was really easy.
0:34
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, not log. Level equals.
1:05
We have this new Marais shin log level, so we 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.
1:15
If you want to control where it goes, just like the database we create this class that drive from sub template logger in this case and implement a few methods trace, invoke and so on and was gonna integrate with logbook.
1:28
We're gonna create a logbook here and whatever the system asked us to do a trace, long as we check that we should do that. Trace right.
1:35
Gonna check the level there, 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 markdown sub template and wrap it in