Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
romainbsl committed Jun 27, 2022
1 parent 7084a66 commit 3f2e8a0
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<img alt="KODEIN-LOG" src="https://raw.githubusercontent.com/kosi-libs/Kodein-Log/master/doc/modules/ROOT/images/kodein-log-logo.svg" width="700">
# Canard - Kotlin Multiplatform Logging library
4 changes: 2 additions & 2 deletions canard/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ kodein {
}

kodeinUpload {
name = "Kodein-Log"
description = "Kodein Log Library"
name = "Canard"
description = "Kotlin Multiplatform Log Library"
}
12 changes: 6 additions & 6 deletions doc/antora.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: kodein-log
title: Kodein-Log
version: '0.13'
display_version: '0.13.0'
name: canard
title: canard
version: '0.14'
display_version: '0.14.0'
nav:
- modules/ROOT/nav.adoc
- modules/core/nav.adoc
asciidoc:
attributes:
version: '0.13.0'
kotlin: '1.6.20'
version: '0.14.0'
kotlin: '1.7.0'
jdk: '1.8'
1 change: 0 additions & 1 deletion doc/modules/ROOT/images/kodein-log-logo.svg

This file was deleted.

6 changes: 3 additions & 3 deletions doc/modules/ROOT/pages/getting-started.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

= Getting started with Kodein-Log
= Getting started with Canard

NOTE: This guide assumes a JVM target.
Kodein-Log works exactly the same on all targets that are supported by Kotlin (JVM, Android, JS, Native).
Canard works exactly the same on all targets that are supported by Kotlin (JVM, Android, JS, Native).

== Install

Expand All @@ -20,7 +20,7 @@ Then add the dependency:
[source,groovy,subs="attributes"]
----
dependencies {
implementation 'org.kodein.log:kodein-log:{version}'
implementation 'org.kodein.log:canard:{version}'
}
----

Expand Down
12 changes: 6 additions & 6 deletions doc/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
image::kodein-log-logo.svg[KODEIN-LOG, 700]

[.lead]
*_Kodein-Log_* is a lightweight Kotlin/Multiplatform logging library with a simple API, that works on JVM, Android, JavaScript, iOS, as well as for all Kotlin/Native targets.
*_Canard_* is a lightweight Kotlin/Multiplatform logging library with a simple API, that works on JVM, Android, JavaScript, iOS, as well as for all Kotlin/Native targets.

*_Kodein-Log_* allows you to:
*_Canard_* allows you to:

- easily setup logging in a Kotlin/Multiplatform
- simply log what you need on different level
- avoid carrying about platform specific frontends' implementations
*_Kodein-Log_* is a good choice because:
*_Canard_* is a good choice because:

- it integrates nicely with all the Kotlin/Multiplatform targets
- it is small and simple to grasp with an easy and understandable API
Expand All @@ -23,7 +23,7 @@ val loggerFactory = LoggerFactory(defaultLogFrontend)
val logger = newLogger(loggerFactory)
logger.info { "Welcome to ..." }
logger.warning { "... the Kodein-Log documentation!" }
logger.warning { "... the Canard documentation!" }
----

== Support
Expand All @@ -35,8 +35,8 @@ logger.warning { "... the Kodein-Log documentation!" }

Contributions are very welcome and greatly appreciated! The great majority of pull requests are eventually merged.

To contribute, simply fork https://github.com/Kodein-Framework/Kodein-Log[the project on Github], fix whatever is iching you, and submit a pull request!
To contribute, simply fork https://github.com/kosi-libs/Canard[the project on Github], fix whatever is iching you, and submit a pull request!

I am sure that this documentation contains typos, inaccuracies and languages error (English is not our mother tongue).
If you feel like enhancing this document, you can propose a pull request that modifies https://github.com/Kodein-Framework/Kodein-Log/tree/master/doc[the documentation documents].
If you feel like enhancing this document, you can propose a pull request that modifies https://github.com/kosi-libs/Canard/tree/master/doc[the documentation documents].
(Documentation is auto-generated from those).
2 changes: 1 addition & 1 deletion doc/modules/core/pages/advanced.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[[custom-frontends]]
== Working with custom frontends

*_Kodein-Log_* is a facade for multiplatform developers that need an easy way to log without worrying about platform specific implementation. For that we provide xref:usage.adoc#default-frontends[[default frontends]] that are default output capacities, for each possible target of Kotlin/Multiplatform.
*_Canard_* is a facade for multiplatform developers that need an easy way to log without worrying about platform specific implementation. For that we provide xref:usage.adoc#default-frontends[[default frontends]] that are default output capacities, for each possible target of Kotlin/Multiplatform.

However, we can think of a lot of use cases that might not covered by default frontends, ike saving the logs into a file, sending the logs to an upstream system, etc.

Expand Down
12 changes: 6 additions & 6 deletions doc/modules/core/pages/install.adoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[[install]]
= Install

IMPORTANT: *_Kodein-Log_* uses the new gradle native dependency model.
IMPORTANT: *_Canard_* uses the new gradle native dependency model.
Thus, we highly recommend to use Gradle 6 or higher.

[[install-kmp]]
== Kotlin/Multiplatform

NOTE: Kodein-Log supports the following targets: +
NOTE: Canard supports the following targets: +
jvm, iosArm32, iosArm64, iosX64, JS, tvosarm64, tvosx64, watchosarm32, watchosarm64, watchosx86, linuxArm32Hfp, linuxMips32, linuxMipsel32, linuxX64, macosX64, mingwX64.

In your `build.gradle.kts` file, add the Maven Central repository:
Expand All @@ -27,7 +27,7 @@ kotlin {
sourceSets {
commonMain {
dependencies {
implementation("org.kodein.log:kodein-log:{version}")
implementation("org.kodein.log:canard:{version}")
}
}
}
Expand All @@ -48,7 +48,7 @@ enableFeaturePreview("GRADLE_METADATA")
[[install-jvm]]
== JVM & Android

On the JVM, *_Kodein-Log_* is compatible with both standard JVM and Android environments, with the same configuration.
On the JVM, *_Canard_* is compatible with both standard JVM and Android environments, with the same configuration.

First, add the Maven Central repository:

Expand All @@ -64,7 +64,7 @@ Then add the dependency:
[source,kotlin,subs="attributes"]
----
dependencies {
implementation("org.kodein.log:kodein-log-jvm:{version}")
implementation("org.kodein.log:canard-jvm:{version}")
}
----

Expand All @@ -85,6 +85,6 @@ Then add the dependency:
[source,kotlin,subs="attributes"]
----
dependencies {
implementation("org.kodein.log:kodein-log-js:{version}")
implementation("org.kodein.log:canard-js:{version}")
}
----
22 changes: 11 additions & 11 deletions doc/modules/core/pages/usage.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
= Kodein-Log usage
= Canard usage

*_Kodein-Log_* allows to easily log any message, with a simple API.
This guide is meant to walk you through all you need to know and use *_Kodein-Log_*.
*_Canard_* allows to easily log any message, with a simple API.
This guide is meant to walk you through all you need to know and use *_Canard_*.

NOTE: *_Kodein-Log_* API is the same for all the Kotlin/Multiplatform targets.
NOTE: *_Canard_* API is the same for all the Kotlin/Multiplatform targets.
However, under the hood each platform uses its own implementation (see xref:default-frontends[default frontends]).

[[logger]]
Expand Down Expand Up @@ -74,17 +74,17 @@ More details in xref:logger-factory[factory] section.
[[default-frontends]]
=== Default frontends

*_Kodein-Log_* is lightweight because it is just a facade that we plug on top of logging systems.
_Frontends_ represent the implementations of the logging systems that *_Kodein-Log_* relies on to output your logs, depending on the platform your application is running on.
*_Canard_* is lightweight because it is just a facade that we plug on top of logging systems.
_Frontends_ represent the implementations of the logging systems that *_Canard_* relies on to output your logs, depending on the platform your application is running on.

The main reason behind *_Kodein-Log_* existence is that we want to provide an easy way of logging for Kotlin/Multiplatform developers, without worrying about the platform specifics. Therefore, *_Kodein-Log_* has the notion of default frontends, that uses the _expect/actual_ mechanism, sending the logs to the right output, depending on the actual platform. Those default implementations are accessible with the property `defaultLogFrontend`.
The main reason behind *_Canard_* existence is that we want to provide an easy way of logging for Kotlin/Multiplatform developers, without worrying about the platform specifics. Therefore, *_Canard_* has the notion of default frontends, that uses the _expect/actual_ mechanism, sending the logs to the right output, depending on the actual platform. Those default implementations are accessible with the property `defaultLogFrontend`.

[source,kotlin]
.use default log frontend
----
Logger.from(defaultLogFrontend) // <1>
----
<1> Use the specific frontend defined by *_Kodein-Log_*
<1> Use the specific frontend defined by *_Canard_*

Here is a table that expose which implementation are used, by
targeted platform.
Expand Down Expand Up @@ -124,7 +124,7 @@ TIP: Remember that you can define your own xref:advanced.adoc#custom-frontends[f
[[severity]]
=== Severity

As for any logging library *_Kodein-Log_* provide different severities to log messages:
As for any logging library *_Canard_* provide different severities to log messages:

- `logger.debug("Hey!")` -> `DEBUG: <TIME> | <TAG>: Hey!`
- `logger.info("Hey!")` -> `INFO: <TIME> | <TAG>: Hey!`
Expand All @@ -150,7 +150,7 @@ logger.warning { "Its me." } // <3>
[[logger-factory]]
== Share a configuration across your application's loggers

This section is for you if you intend to use *_Kodein-Log_* for more than one `Logger` using the same configuration.
This section is for you if you intend to use *_Canard_* for more than one `Logger` using the same configuration.
Having multiple loggers with identical configuration in your codebase could end like in the following snippet:

[source,kotlin]
Expand Down Expand Up @@ -254,7 +254,7 @@ factory.newLogger<Int>().error { "I know an Int." } // <6>
.Output
ERROR: 2021-04-02T13:28:54.201783 | java.lang.Integer: I know an Int.

WARNING: By filtering a `Tag` or a package, *_Kodein-Log_* might ignore WARNING and ERROR messages.
WARNING: By filtering a `Tag` or a package, *_Canard_* might ignore WARNING and ERROR messages.

=== Adding the stacktrace for each log

Expand Down

0 comments on commit 3f2e8a0

Please sign in to comment.