This is the first installment of the blog post series describing application logging. The posts are going to be short. I use Go, but most of the concepts is should be language agnostic. I will try to list good supplemental references. First, I want to present a demo application go-structured-logging-demo, which I will use to … Continue reading Logging #1: Demo Application
Tag: golang
Logrusutil v1.0.0
After a week I have released logrusutil v1.0.0. What took me at least 80% of the time? Writing GoDocs, example application and readme files.Setting up continuous integration with GitHub Actions and GolangCI.Testing the library consumption via Go Modules, go get and dep.
Logrusutil = Contextual Logging + Error Fields for Logrus
In past two days I have created logrusutil which is a small utility library for logrus. Currently it contains two packages. I encourage to look at the GoDoc examples: logctxerrfield Feedback highly appreciated. You can write a comment here, create an issue on GitHub, write to me on LinkedIn/Facebook or even send an email. In … Continue reading Logrusutil = Contextual Logging + Error Fields for Logrus
Parsing Configuration
Most of the software needs some kind of configuration, which is dynamically loaded during runtime. Application Configuration For applications, usually the best place where to parse the application configuration is Composition Root, preferably close to the program entry. package main import ( "log" "github.com/caarlos0/env/v6" ) func main() { var cfg struct { URL string `env:"URL,required"` … Continue reading Parsing Configuration
Do not believe any documentation
TL;DR; Do not believe any documentation. It might be incorrect or you may not understand it. Test everything. MSDN lies A few months ago I was writing some code in C# to get executable paths for all running processes. Generally, I tried the most common approach using BCL: string executablePath = process.MainModule.FileName; However, for some … Continue reading Do not believe any documentation