User-Friendly Logging With TypeScript and Node.js

Writing comprehensive logging using text styling and emojis

Nuno Brites
The Startup

--

In this article, we will create a simple and comprehensive way of logging our application behavior and data by using text styling and emojis in TypeScript and Node.js.

This article came from the need I had when building a script that would fetch the status of users from a database and create a simple report with the returned status in the console.

Software development is a way to build experiences for end-users and sometimes we as software engineers are our own end users. In this article, we will use the example above and build a solution that uses text styling and emojis to give more meaning to the information being displayed in the console output.

📝 In this article, we will use TypeScript as a programming language but the concepts being presented can be implemented in any other language.

Requirements

With the main goal of showing a list of the users status on the console let’s have a detailed look into the requirements:

  • Fetch user name and status from database
  • The user can be in one of the following states: active, inactive, toBeRemoved, removed

--

--

Nuno Brites
The Startup

Software engineer driven by curiosity, writing about software development and tech ✏️ 🚀