logging

Installation
SKILL.md

Logging

One idiom

A private logger at the top of the file, outside the class:

private val logger = KotlinLogging.logger {}

The empty lambda gives the logger the enclosing file's name, so nothing has to be kept in step with a rename. File-level and private means one per file, shared by everything in it, and never exposed as API.

Do not declare it in a companion object, do not pass a logger as a constructor parameter, and do not inject one. There is exactly one way to get a logger here.

Always the lambda form

Installs
11
First Seen
Aug 7, 2026
logging — joaoseidel/ktor-toolkit