Yakl - Yet Another Kotlin Logger

Related tags

Logger yakl
Overview

YAKL

Yet Another Kotlin Logger.

Motivation

Current jvm loggers have some disadvantages. They have

  1. Magic configuration.
    a) Implicit implementation selector via classpath scan. If you have multiple implementations, they are blow up. It's annoying with transitive dependencies.
    b) Configuration via hierarchical scan of XMLs in classpath.
    c) Developer should read documentation which dependency he has to add to classpath for usage new XML tags
    d) Developer could write wrong configuration, because it's XML without compiler checks
  2. Does not support default args and lambdas. In order, API, which should be simple, has to many methods, and a little ugly. For convenient API we use wrappers like kotlin-logging
  3. Implicit usage
    a) Passing log context via ThreadLocals is implicit. It creates errors when you use concurrency. I know about solutions (CustomThreadPools, or CoroutineDispatcher), but it's ugly.
    b) Implicit logger creation via static methods.
  4. Overcomplicated
    a) Logger inheritance, JNDI calls, and many others "features". Most server side usages, just would like write Strings to stdout, and store them to ELK, Splunk, etc.

This project is attempt to create new logger for kotlin-jvm without these "mistakes"

Features

  1. Code configuration. Use kotlin-dsl for logger configuration. You could override almost anything. Yep, you could do it in runtime (if you need it).
  2. Simple api. Look into api module and read three simple classes.
  3. Explicit usage. You pass everything explicitly. If you need implicit usage, you could easy wrap Logger and store context in ThreadLocals, CoroutineContexts or your custom storage.

Modules

  1. api - use this module if you write a library which should log something.
  2. stdout - use this module in your application for log something to stdout.
  3. core - use this module if you would like extend standard realization of YAKL
  4. slf4j - adapter for slf4j.

Current Status

YAKL in alpha testing. It does not have guarantees for API and support.

Project will change status to beta testing when it receives

  1. Quality Gates
  2. Deployment
  3. 50 stars on github. (Community like it, and this is not waste of time)

Example

val loggerFather = logging {
    stdout("stdout") {
        filter = LoggerNameFilter(
            Regex(".*") to LogLevel.INFO,
            Regex("example.*") to LogLevel.DEBUG
        )
        formatter = LogFormatter { builder, msg ->
            val time = dateFormatter.format(msg.time)
            builder.append("$time [${msg.level}] ${msg.loggerName} : ${msg.content}")
        }
    }
    registerSlf4jAdapter()
}
val logger = loggerFather.createLogger(name = "my-new-logger")
You might also like...
Kermit is a Kotlin Multiplatform logging utility with composable log outputs

Kermit is a Kotlin Multiplatform logging utility with composable log outputs. The library provides prebuilt loggers for outputting to platform logging tools such as Logcat and NSLog.

A tiny Kotlin API for cheap logging on top of Android's normal Log class.
A tiny Kotlin API for cheap logging on top of Android's normal Log class.

A tiny Kotlin API for cheap logging on top of Android's normal Log class.

Kotlin multi-platform logging library with structured logging and coroutines support
Kotlin multi-platform logging library with structured logging and coroutines support

Klogging Klogging is a pure-Kotlin logging library that aims to be flexible and easy to use. It uses Kotlin idioms for creating loggers and sending lo

A demonstration of Kotlin-logging with logback.

try-kotlin-logging A demonstration of Kotlin-logging with logback. Usage # output a log to STDOUT and file(myApp.log) $ ./gradlew run # = 2021-12-11

Kotlin Multiplatform Mobile version of Tisdagsgolfen... yet another version.

TheCube in Kotlin Multiplatform Experimenting with KMM, and Kotlin, Jetpack, SwiftUI, and all the other new stuff... https://kotlinlang.org/docs/kmm-g

🗂 Yet Another One Way to Handle Your Dockerfiles with Kotlin

🐳 Dokker The Kotlin DSL to generate your project Dockerfiles with Kotlin. Example The library is created with one purpose: allow easy generation of m

Yet another android custom progress view for your music player
Yet another android custom progress view for your music player

MaskProgressView Yet another android custom progress view for your music player Demo Youtube Video Link Usage co.mobiwise.library.MaskProgressView

Yet another Twitter unofficial client for Lollipop.
Yet another Twitter unofficial client for Lollipop.

Tweetin Yet another Twitter unofficial client. Just design for Lollipop now!!! Screenshot: How to use the source code? Just import the Tweetin folder

Yet another barcode scanner for Android
Yet another barcode scanner for Android

Binary Eye Yet another barcode scanner for Android. As if there weren't enough. This one is free, without any ads and open source. Works in portrait a

YASNAC (short for Yet Another SafetyNet Attestation Checker) is an Android app that demonstrates SafetyNet Attestation API.

YASNAC YASNAC (short for Yet Another SafetyNet Attestation Checker) is an Android app that demonstrates SafetyNet Attestation API. YASNAC is written w

Yet another ToDo app, but the UI completely written in Jetpack Compose!
Yet another ToDo app, but the UI completely written in Jetpack Compose!

Yet another ToDo app, but the UI completely written in Jetpack Compose!

Yet another ToDo app, but the UI completely written in Jetpack Compose!
Yet another ToDo app, but the UI completely written in Jetpack Compose!

Yet another ToDo app, but the UI completely written in Jetpack Compose!

Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer.
Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer.

Yet Another Video Player Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer. Who Is YAVP For? First o

Yet Another Native Loader for the JVM.

yanl - yet another native loader Yet another Native library extractor/loader for the JVM, written in Kotlin. why other libraries simply don't fit my n

Yet another booru viewer for Android
Yet another booru viewer for Android

Yet another booru imageboards viewer for Android Download Preview Click Here Building You can build this app just like any other flutter app, for exam

StringFuck - Yet Another String Obfuscator for Android

StringFuck Yet Another String Obfuscator for Android 一个字符串混淆器,旨在防止被jadx、MT等工具一键解

🔥 Yet another Tinder like swipeable cards, built for Jetpack Compose
🔥 Yet another Tinder like swipeable cards, built for Jetpack Compose

twyper Yet another Tinder like swipeable card library, built for Jetpack Compose ✨ Demo Screen.Recording.2022-02-20.at.10.46.59.PM.mov ⌨️ Usage 1. Add

FastHub - Yet another open-source GitHub client app but unlike any other app
FastHub - Yet another open-source GitHub client app but unlike any other app

FastHub - Yet another open-source GitHub client app but unlike any other app

Yet another adapter delegate library.
Yet another adapter delegate library.

Yet another adapter delegate library. repositories { ... maven { url 'https://jitpack.io' } } ... dependencies { implementation("com.git

Owner
Mark Kosichkin
Hello world!
Mark Kosichkin
Kotlin Multi Platform Logger, for android an ios : Logcat & print

Multiplatform Preferences Use a single object : Logger in your kotlin shared projects to display logs Note you can also use it in your real code on An

Florent CHAMPIGNY 49 Aug 22, 2022
A logger with a small, extensible API which provides utility on top of Android's normal Log class.

This is a logger with a small, extensible API which provides utility on top of Android's normal Log class. I copy this class into all the little apps

Jake Wharton 9.9k Jan 8, 2023
An OkHttp interceptor which has pretty logger for request and response. +Mock support

LoggingInterceptor - Interceptor for OkHttp3 with pretty logger Usage val client = OkHttpClient.Builder() client.addInterceptor(LoggingInterceptor

ihsan BAL 1.3k Dec 26, 2022
✔️ Simple, pretty and powerful logger for android

Logger Simple, pretty and powerful logger for android Setup Download implementation 'com.orhanobut:logger:2.2.0' Initialize Logger.addLogAdapter(new A

Orhan Obut 13.5k Dec 30, 2022
Utility logger library for storing logs into database and push them to remote server for debugging

HyperLog Android Overview Log format Download Initialize Usage Get Logs in a File Push Logs Files to Remote Server Sample Testing Endpoint using Reque

HyperTrack 675 Nov 14, 2022
Logger

StreamingAndroidLogger Introduction Convenient logger that adds support to having multiple different loggers and different log levels for each one of

Jan Rabe 46 Nov 29, 2022
Timber + Logger Integration. Make Logcat Prettier, show thread information and more.

Pretty Timber Android Logcat Timber + Logger Integration Video Instructions: https://youtu.be/zoS_i8VshCk Code App.kt class App : Application() {

Awesome Dev Notes | Android Dev Notes YouTube 29 Jun 6, 2022
Pluto Logger is a Pluto plugin to manage and share your Debug logs

Pluto Logger Plugin Pluto Logger is a Pluto plugin to manage and share your Debug logs. It also comes with Timber support. ?? Integrate plugin in your

Pluto 1 Feb 8, 2022
This is an Kotlin Library that enables Annotation-triggered method call logging for Kotlin Multiplatform.

This is an Kotlin Library that enables Annotation-triggered method call logging for Kotlin Multiplatform.

Jens Klingenberg 187 Dec 18, 2022
simple Kotlin logging: colorized logs for Kotlin on the JVM

sklog - simple Kotlin logging Kotlin (JVM) logging library for printing colorized text to the console, with an easy upgrade path to the popular kotlin

null 1 Jul 26, 2022