Using golog
Now that we understand what is available in the standard library, we want to explore the option of using a library that can provide us with more flexibility. We will look at the golog
open source project (https://github.com/kataras/golog). The golog
library is a dependency-free logging library that provides functionality such as leveled logging (INFO
, ERROR
, etc.), JSON-based output, and configurable color output.
One of the most used features of logging is log levels, also known as leveled logging. Log levels are used to categorize output information from an application into different severity levels. The following table shows the different severity levels:
|
Just for information purposes |
|
Something is not running correctly, so keep an eye out for it in case there are more severe errors |
|
...