How To Install golang-github-gologme-log-dev on Ubuntu 22.04

In this tutorial we learn how to install golang-github-gologme-log-dev on Ubuntu 22.04. golang-github-gologme-log-dev is A fork of the golang built in log package to add support for levels (library)

Introduction

In this tutorial we learn how to install golang-github-gologme-log-dev on Ubuntu 22.04.

What is golang-github-gologme-log-dev

golang-github-gologme-log-dev is:

This package is a drop in replacement for the built-in Go log package. All the functionality of the built-in package still exists and is unchanged. In addition, this package contains a series of small enhancements and additions. Namely, it adds five logging levels.

In addition to these five defined logging levels, users can also define their own arbitrary logging levels.

Unlike other loggers, these logging levels are not enabled in a chain. Meaning, once a level is enabled, say Warn, all levels above it are not also enabled. This package is implemented in such a way that users can individually turn on and turn off the various new logging levels. However, starting with v1.3.0 users can enable logging in a chain buy enabling logging levels by number (see below). If existing code uses the build-in log package, no change is needed to use this package.

Another feature that was added, based on comments seen on the various golang boards, is the ability to set the calldepth.

There are three methods to install golang-github-gologme-log-dev on Ubuntu 22.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install golang-github-gologme-log-dev Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install golang-github-gologme-log-dev using apt-get by running the following command:

sudo apt-get -y install golang-github-gologme-log-dev

Install golang-github-gologme-log-dev Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install golang-github-gologme-log-dev using apt by running the following command:

sudo apt -y install golang-github-gologme-log-dev

Install golang-github-gologme-log-dev Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install golang-github-gologme-log-dev using aptitude by running the following command:

sudo aptitude -y install golang-github-gologme-log-dev

How To Uninstall golang-github-gologme-log-dev on Ubuntu 22.04

To uninstall only the golang-github-gologme-log-dev package we can use the following command:

sudo apt-get remove golang-github-gologme-log-dev

Uninstall golang-github-gologme-log-dev And Its Dependencies

To uninstall golang-github-gologme-log-dev and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove golang-github-gologme-log-dev

Remove golang-github-gologme-log-dev Configurations and Data

To remove golang-github-gologme-log-dev configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge golang-github-gologme-log-dev

Remove golang-github-gologme-log-dev configuration, data, and all of its dependencies

We can use the following command to remove golang-github-gologme-log-dev configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge golang-github-gologme-log-dev

References

Summary

In this tutorial we learn how to install golang-github-gologme-log-dev package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.