Adding a CMS to Your Pyramid Web App Transcripts
Chapter: Logging user and system activity
Lecture: Markdown log levels

Login or purchase this course to watch this video and the rest of the course contents.
0:00 the first thing we might want to do with our markdown sub template library is Just tell it. Don't show me all these messages.
0:07 I want you to just show me the really important stuff. So in order to do that, we don't have to do any integration or anything like that.
0:14 We can come over here and import from markdown sub template just like we did storage, logging, and in this innit logging section, we can go down and we could say in de log, I'll get log.
0:27 So then, MD log, we can just like before call these messages were not going to use this directly. As you'll see.
0:33 We're gonna do a little integration with it, but we can set this now. This is a log level that's going to come out of not Harbour.
0:42 But here we can set it to race error and phone aims.
0:47 Let's just say let's just say we want to set it to error and let's put it underscores who were not little warnings about this.
0:53 So now if we run this and we go look over to the admit lips with a click here, notice there's no message from it But maybe if we can get it to have some kind of error, let's go over here and just say this one has an import like that.
1:09 And if we try to view that, let's see. Do we get any message? No.
1:13 Still, it probably should give us a warning like a We couldn't find this this thing right here, but anyway, if something goes too wrong with it, it'll got an exception or something.
1:23 You should see some kind of message out here so you can configure the levels off that thing or just turn it off. You do what you want to see.
1:31 Anything to say, logging off. You'll never see a message from it again. But there is probably good anyway, this is a nice way to control that.
1:39 At least a first pass to filter out some of the messages. You don't want to come in.
1:43 And while we're at it, if we want to just see notices and above, we can come down here and say Level notice And now let's go CR ap run notice.
1:53 We see the notices, but we don't see higher. Let's see what we want. Yeah, we don't see the info stuff.
2:01 So remember if this Waas info here before we said I'm not sure info is the right level, you see, Trace, right? I guess if we That's right, we had it.
2:11 We didn't have anything that was said toe that level. So if we said this to trace, we should see trace and above, which is noticed and trace Perfect.
2:19 We see that, but we don't want to see traces. Remember, You see a lot of stuff in this one.
2:23 If you're over here and you're viewing a page and you look down here, there's a bunch of traces like you don't want to see that in production is even gonna slow things down.
2:32 So you could go to notice or info. And now we can request the heck out of this page, and those are gonna be so set.
2:40 So probably the right thing to do is like, set these two levels like this, but they don't have to be the same. They just can't be there.
2:49 Notice this Didn't have a notice, does it? go with air info. Info is gonna be as close as we can get, I guess. Didn't notice. Here we go.
2:57 Looks like it's all


Talk Python's Mastodon Michael Kennedy's Mastodon