From 81af45ba5d787042fffbdba1e0bc1277ae7e0159 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 12 Jun 2022 02:44:29 +0600 Subject: [PATCH] Update README.md --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b34a350..02b5f4f 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,26 @@ KSLog.i("Some message") KSLog.i("Some tag", "Some message") // OR KSLog.i("Some tag", "Some message", IllegalArgumentException("So, that is exception :)")) +// OR +KSLog.i("Some optional tag", Exception("Optional")) { "Lazy inited message" } +// OR +KSLog.iS("Some optional tag", Exception("Optional")) { "Lazy inited message for suspendable calculation of text" } // OR EVEN KSLog.l(LogLevel.INFO, "Some tag", "Some message", IllegalArgumentException("So, that is exception :)")) +// OR +KSLog.l(LogLevel.INFO, "Some optional tag", IllegalArgumentException("So, that is exception :)")) { "And lazily inited message" } ``` ### A little bit deeper -There are several important things in context of this library: +There are several important "terms" in context of this library: -* Default logger (available via `KSLog`) +* Default logger (available via `KSLog.default`) * Local logger (can be created via `KSLog` functions and passed anywhere as `KSLog`) * Logging shortcuts like `KSLog.i`/`KSLog.info` +Every logging extension (like `KSLog.i`) have its analog with lazy inited message text and the same one with suffix `S` (like `KSLog.iS`) for the suspendable message calculation. + Default logger can be created by passing `defaultTag` and one of variants log level filters: set or minimal loggable level. In `JVM` you also may setup any logger as base logger for default realizations of `KSLog`. Besides, you may use your own callback (on **any target platform**) as output of logging: ```kotlin