Buying Real Estate in Belize

The real estate market in Belize continues to be hot as more and more European and North American residents decide to invest. Whether you’re buying a property as an investment or as a place to live…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Colored Logs for Python

Printing colored messages to the console

Logging is an essential part of developing applications and lead to quick debugging and a broader understanding of what’s going on in your app. In this easy and short article we’re going to make our console logs a bit clearer by adding some color. Let’s code!

We first need to install a package

Also make sure you understand the basics of logging and how to add a handler to your log with the article below:

Nothing new here: we just create a logger

We use the getLogger method so that we don’t use the root logger.

Here we install coloredlogs on our logger.

The last line makes sure that coloredlogs doesn’t pass our log events to the root logger. This prevents that we log every event double.

We want to add some style to our console outputs. We’ll define that here

Add a comment

Related posts:

HawSwap x Satoshi Club AMA Recap from 7th of December

Hawswap is a new basic protocol for decentralized financial services based on Ethereum, used to build AMM decentralized exchange HawSwap, trustless auction platform HawLaunch & decentralized option…

Nobody expects Completion Inquisition!

Testing completion-handler API happy path scenario is really simple with XCTestExpectation. Things get complicated if your test case has to verify whether given handler was not called. It is still…

The Struggle of Conceptualizing Sexual Assault

A college girl arrives at a man’s house drunk, so drunk that she could feel the ground spinning at a Frat party. She remembers very little of what even happened at the party. She couldn’t even tell…