Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

312 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lognity

Repository Version
Package Registry
Maven Central

A lightweight logging facade and implementation for Kotlin Multiplatform.
It integrates with existing libraries and APIs like java.logging, slf4j and Ktor.

How to use it

First, add the official Maven Central repository to your settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        maven("https://central.sonatype.com/repository/maven-snapshots")
        mavenCentral()
    }
}

Then add a dependency on the library in your root buildscript:

kotlin {
    sourceSets {
        commonMain {
            dependencies {
                implementation("de.connect2x.lognity:lognity-api:<version>")
                implementation("de.connect2x.lognity:lognity-core:<version>")
            }
        }
    }
}

Quickstart

Note: for more detailed information about the features of this library,
please check out the single-file wiki!

In order to get started with Lognity, you need to pick a backend implementation.

// Use the default backend provided by the lognity-core module
Backend.set(DefaultBackend)

Note: if no backend is selected explicitly, a NoopBackend will be provided.

Optionally, you may also pick a default configuration for all newly created Loggers.

Creating a Logger

You should always define your loggers as the interface type Logger from the lognity-api module.
New instances of this type may be obtained using the Logger pseudo-constructor.

// Creates a new logger with the default name
val myLogger: Logger = Logger()

// Creates a new logger with the specified name
val myOtherLogger: Logger = Logger("Other")

Examples

Examples on how to use the Lognity API can be found in the lognity-example module.

About

Kotlin Multiplatform logging library - this is a mirror of https://gitlab.com/connect2x/lognity

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages