Search Results for: logging

An Intro to Logging with Python and Loguru

Python’s logging module isn’t the only way to create logs. There are several third-party packages you can use, too. One of the most popular is Loguru. Loguru intends to remove all the boilerplate you get with the Python logging API. You will find that Loguru greatly simplifies creating logs in Python. This chapter has the following sections: Installation […]

An Intro to Logging with Python and Loguru Read More »

One Week Left for Python Logging Book / Course Kickstarter

My latest Python book campaign is ending in less than a week. This book is about Python’s logging module. I also include two chapters that discuss structlog and loguru. Support on Kickstarter  Why Back A Kickstarter? The reason to back the Kickstarter is that I have exclusive perks there that you cannot get outside of

One Week Left for Python Logging Book / Course Kickstarter Read More »

Announcing The Python Logging Book & Course Kickstarter

What does every new developer do when they are first learning to program? They print out strings to their terminal. It’s how we learn! But printing out to the terminal isn’t what you do with most professional applications. Support on Kickstarter  In those cases, you log into files. Sometimes, you log into multiple locations at

Announcing The Python Logging Book & Course Kickstarter Read More »

Python: How to Create an Exception Logging Decorator

The other day, I decided I wanted to create a decorator to catch exceptions and log them. I found a rather complex example on Github that I used for some ideas on how to approach this task and came up with the following: # exception_decor.py import functools import logging def create_logger(): “”” Creates a logging

Python: How to Create an Exception Logging Decorator Read More »

wxPython: How to Redirect Python’s Logging Module to a TextCtrl

Today I was reading the wxPython Google group / mailing list and there was someone asking about how to make Python’s logging module write its output to file and to a TextCtrl. It turns out that you need to create a custom logging handler to do it. At first, I tried just using a normal

wxPython: How to Redirect Python’s Logging Module to a TextCtrl Read More »

Python 101: An Intro to logging

Python provides a very powerful logging library in its standard library. A lot of programmers use print statements for debugging (myself included), but you can also use logging to do this. It’s actually cleaner to use logging as you won’t have to go through all your code to remove the print statements. In this tutorial

Python 101: An Intro to logging Read More »