Skip to content

Commit fd7744c

Browse files
committed
update readme for version 4 beta.
1 parent 23e2365 commit fd7744c

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
# <img height="30" width="30" alt="kotlin-logging" src="https://raw.githubusercontent.com/oshai/kotlin-logging/master/misc/images/kotlin-logging.png"> [kotlin-logging](https://github.com/oshai/kotlin-logging) [![CI](https://github.com/oshai/kotlin-logging/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/oshai/kotlin-logging/actions/workflows/ci.yml) [![Slack channel](https://img.shields.io/badge/Chat-Slack-blue.svg)](https://kotlinlang.slack.com/messages/kotlin-logging/) [![Maven Central](https://img.shields.io/maven-central/v/io.github.microutils/kotlin-logging.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.github.microutils%22) [![Apache License V.2](https://img.shields.io/badge/license-Apache%20V.2-blue.svg)](https://github.com/oshai/kotlin-logging/blob/master/LICENSE)
1+
# <img height="30" width="30" alt="kotlin-logging" src="https://raw.githubusercontent.com/oshai/kotlin-logging/master/misc/images/kotlin-logging.png"> [kotlin-logging](https://github.com/oshai/kotlin-logging) [![CI](https://github.com/oshai/kotlin-logging/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/oshai/kotlin-logging/actions/workflows/ci.yml) [![Slack channel](https://img.shields.io/badge/Chat-Slack-blue.svg)](https://kotlinlang.slack.com/messages/kotlin-logging/) [![Maven Central](https://img.shields.io/maven-central/v/io.github.oshai/kotlin-logging.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.github.oshai%22) [![Apache License V.2](https://img.shields.io/badge/license-Apache%20V.2-blue.svg)](https://github.com/oshai/kotlin-logging/blob/master/LICENSE)
22

3-
Curious to try version 4? See https://github.com/oshai/kotlin-logging/issues/264 for details.
4-
5-
##
6-
7-
Lightweight logging framework for Kotlin, written in [![Pure Kotlin](https://img.shields.io/badge/100%25-kotlin-blue.svg)](https://kotlinlang.org/).
3+
Lightweight Multiplatform logging framework for Kotlin, written in
4+
[![Pure Kotlin](https://img.shields.io/badge/100%25-kotlin-blue.svg)](https://kotlinlang.org/).
85
A convenient and performant logging facade.
96
For jvm `kotlin-logging` is wrapping [slf4j](http://www.slf4j.org/) with Kotlin extensions.
107
For other platforms `kotlin-logging` has various implementations. More details in the [wiki](https://github.com/oshai/kotlin-logging/wiki/Multiplatform-support)
@@ -41,7 +38,7 @@ logger.error(exception) { "a $fancy message about the $exception" }
4138
## Getting started
4239

4340
```Kotlin
44-
import mu.KotlinLogging
41+
import io.github.oshai.KotlinLogging
4542
private val logger = KotlinLogging.logger {}
4643
class FooWithLogging {
4744
val message = "world"
@@ -53,25 +50,54 @@ class FooWithLogging {
5350

5451
An `Android` example project with kotlin-logging can be found in [kotlin-logging-example-android](https://github.com/oshai/kotlin-logging-example-android).
5552

53+
## Version 4.x vs. previous versions
54+
55+
Version 4 is still in beta but you're encourage to try it!
56+
Version 4 is not backward compatible with previous versions.Group id (in maven) and packages names changed.
57+
It is possible to use both version 4 and previous versions side-by-side so some of the code from the old version
58+
and some new. It is also possible to have libs using old version and use the new version. In that sense it's
59+
a completely new dependency.
60+
61+
Main changes are:
62+
- Maven group id changed from `io.github.microutils` -> `io.github.oshai`.
63+
- Root package change from `mu` -> `io.github.oshai`.
64+
- Slf4j dependency is not provided anymore (users have to provide it). It means that 4.x can work with both slf4j 1 or 2.
65+
- There are changes to multiplatform class hierarchy that might break compatibility.
66+
67+
More details in issue [#264](https://github.com/oshai/kotlin-logging/issues/264).
68+
5669
## Download
5770

5871
**Important note:** kotlin-logging depends on slf4j-api (in the JVM artifact). In runtime, it is also required to depend on a logging implementation. More details in [how-to-configure-slf4j](http://saltnlight5.blogspot.co.il/2013/08/how-to-configure-slf4j-with-different.html). And an excellent detailed explanation in [a-guide-to-logging-in-java](https://www.marcobehler.com/guides/a-guide-to-logging-in-java).
72+
In version 4 users should also provide slf4j-api dependency.
5973

6074
In short, if you just want to log statements to stdout, it's possible to add the following dependency: `org.slf4j:slf4j-simple:2.0.3`.
6175

6276
### Maven
6377
```xml
78+
<dependency>
79+
<groupId>io.github.oshai</groupId>
80+
<artifactId>kotlin-logging-jvm</artifactId>
81+
<version>4.0.0-beta-11</version>
82+
</dependency>
83+
```
84+
Or
85+
```xml
6486
<dependency>
6587
<groupId>io.github.microutils</groupId>
6688
<artifactId>kotlin-logging-jvm</artifactId>
67-
<version>3.0.4</version>
89+
<version>3.0.5</version>
6890
</dependency>
6991
```
7092
See the full example in [kotlin-logging-example-maven](https://github.com/oshai/kotlin-logging-example-maven).
7193

7294
### Gradle
7395
```Groovy
74-
implementation 'io.github.microutils:kotlin-logging-jvm:3.0.4'
96+
implementation 'io.github.oshai:kotlin-logging-jvm:4.0.0-beta-11'
97+
```
98+
Or
99+
```Groovy
100+
implementation 'io.github.microutils:kotlin-logging-jvm:3.0.5'
75101
```
76102

77103
Alternatively, download the JAR from [github](https://github.com/oshai/kotlin-logging/releases/latest) or [maven-central](https://repo1.maven.org/maven2/io/github/microutils/kotlin-logging/).

0 commit comments

Comments
 (0)