Categories
javascript

Lazy/conditional logging in JavaScript

I had some trace logs that I only wanted to enable conditionally, eg only when the logging level was set to TRACE. I couldn’t find a node.js library that enables this kind of logging. For each of them, the logger always evaluated the string input. The longRunningTask was always ran, even if trace logging was […]

Categories
Android Apps Architecture iOS Kotlin Multiplatform Multiplatform Mobile

Kotlin Multiplatform logging libraries

When developing with any platform, the existence of libraries is assumed. This is to delegate common tasks to out project code, in order to reduce development time and avoid common pitfalls already solved by other developers. Kotlin Multiplatform(KMM) is no different. Available libraries Since Kotlin is becoming more popular among Android/JVM developers, one might expect […]

Categories
Android Architecture Kotlin testing

Logging in a Java library

It can be useful to emit logs in a library. When doing so, one needs to consider when to emit, how to filter and who is responsible for printing/handling the logs. Correct logging should also be tested. When to log There are different reasons to emit a message, for instance on important events, undefined behaviour […]