mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2025-11-07 06:50:14 +00:00
Compare commits
78 Commits
v1.2.1
...
renovate/g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a998a0c6b | ||
| 8c0968ba86 | |||
| 526de46a98 | |||
| 0af8c78e37 | |||
| 6840598e04 | |||
| 7a2d070ee3 | |||
| 92651d3ba6 | |||
| b8c72f1131 | |||
| 9b92fa29f4 | |||
| 42ced6edd2 | |||
| dd3e4c4c2a | |||
| f528909915 | |||
| b3919c8439 | |||
| d1dd159e36 | |||
| 3db55982e9 | |||
| 8e477b1056 | |||
| 480d2c8132 | |||
| a2a73dfe83 | |||
| 4528918347 | |||
|
|
9ef93724ad | ||
| dccbd13788 | |||
| 8bb34d6842 | |||
| cff3f71de7 | |||
| aab0ac064f | |||
| d2909ed5f0 | |||
| 81eba88ce9 | |||
| a73f0d132c | |||
| bd87184f81 | |||
| 7228e81344 | |||
| ac828b1af7 | |||
| a8c85b9614 | |||
| 98fbf43d4d | |||
| ef8a3e1500 | |||
| 3edbb78d56 | |||
| 663395ccbe | |||
| ecd2b08c69 | |||
| f5e50d00a2 | |||
| a1784dc6af | |||
| 4d6410c870 | |||
| 3a4035f1a6 | |||
| 86bf9468ba | |||
| 24adeef67b | |||
| 4823df5c6f | |||
| 2d397e9b12 | |||
| 37a0fceb56 | |||
| 0860d6cacc | |||
| d9863ded5a | |||
| 48a265e3d5 | |||
| 30cdbea2c9 | |||
| b19639e8a1 | |||
| 447e4fe5ac | |||
| 30d82ebda6 | |||
| 0b7b408b06 | |||
| ea43501a03 | |||
| 0348756729 | |||
| 81b32b0119 | |||
| 7a8bd035f5 | |||
| 34a7c9624d | |||
| fb0f61bb15 | |||
| 48eeb6660e | |||
| ff14fd5e7c | |||
| aa7bd6179a | |||
| ef72365505 | |||
| c0a10436be | |||
| a3170786a7 | |||
| d60e35f1e9 | |||
| bed00407fb | |||
| f326d9070a | |||
| b4c454141e | |||
| 1a589c675e | |||
| d25a73df3d | |||
| 333cb690a1 | |||
| a3e6ccf973 | |||
| 9ce62e13f5 | |||
| e88df8db99 | |||
| 8613f350e3 | |||
| 7fbf80a52a | |||
| 00da37e060 |
2
.github/workflows/kdocs.yml
vendored
2
.github/workflows/kdocs.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 17
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew dokkaHtml
|
run: ./gradlew dokkaHtml
|
||||||
- name: Publish KDocs
|
- name: Publish KDocs
|
||||||
|
|||||||
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v1
|
- uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 17
|
||||||
- name: Rewrite version
|
- name: Rewrite version
|
||||||
run: |
|
run: |
|
||||||
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.kotlin
|
||||||
|
kotlin-js-store/
|
||||||
out/*
|
out/*
|
||||||
*.iml
|
*.iml
|
||||||
target
|
target
|
||||||
@@ -12,6 +14,6 @@ out/
|
|||||||
secret.gradle
|
secret.gradle
|
||||||
local.*
|
local.*
|
||||||
local/
|
local/
|
||||||
kotlin-js-store/
|
**/*.local.*
|
||||||
|
|
||||||
publishing.sh
|
publishing.sh
|
||||||
|
|||||||
71
CHANGELOG.md
71
CHANGELOG.md
@@ -1,5 +1,76 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 1.5.1
|
||||||
|
|
||||||
|
* `Kotlin`: `2.2.20`
|
||||||
|
|
||||||
|
## 1.5.0
|
||||||
|
|
||||||
|
* `Kotlin`: `2.2.0`
|
||||||
|
|
||||||
|
## 1.4.2
|
||||||
|
|
||||||
|
* `Kotlin`: `2.1.21`
|
||||||
|
* Android SDK Level: `36`
|
||||||
|
|
||||||
|
## 1.4.1
|
||||||
|
|
||||||
|
* `Kotlin`: `2.1.10`
|
||||||
|
|
||||||
|
## 1.4.0
|
||||||
|
|
||||||
|
* `Kotlin`: `2.1.0`
|
||||||
|
|
||||||
|
## 1.3.6
|
||||||
|
|
||||||
|
* `Kotlin`: `2.0.20`
|
||||||
|
|
||||||
|
## 1.3.5
|
||||||
|
|
||||||
|
* `Kotlin`: `2.0.10`
|
||||||
|
* Android SDK Level: `35`
|
||||||
|
|
||||||
|
## 1.3.4
|
||||||
|
|
||||||
|
* `Kotlin`: `1.9.24`
|
||||||
|
* Native realization of `KSLoggerDefaultPlatformLoggerLambda` now is common for all native targets
|
||||||
|
|
||||||
|
## 1.3.3
|
||||||
|
|
||||||
|
* `Kotlin`: `1.9.23`
|
||||||
|
|
||||||
|
## 1.3.2
|
||||||
|
|
||||||
|
* `Kotlin`: `1.9.22`
|
||||||
|
|
||||||
|
## 1.3.1
|
||||||
|
|
||||||
|
* `Kotlin`: `1.9.21`
|
||||||
|
|
||||||
|
## 1.3.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS CHANGES OF LOG LEVELS ACCORDANCES. LOOK AT THE LEVELS ACCORDANCE IN THE [DOCUMENTATION](https://docs.inmo.dev/kslog/logging.html#logging)
|
||||||
|
FOR MORE INFO**
|
||||||
|
|
||||||
|
* Add `trace` logging level
|
||||||
|
* Change overall table of log level accordance
|
||||||
|
* Now you may change default platform logger
|
||||||
|
|
||||||
|
## 1.2.4
|
||||||
|
|
||||||
|
**This update contains migration onto gradle 8+ (for both wrapper and android plugin). Use it with caution**
|
||||||
|
|
||||||
|
## 1.2.3
|
||||||
|
|
||||||
|
* `Kotlin`: `1.9.20`
|
||||||
|
|
||||||
|
## 1.2.2
|
||||||
|
|
||||||
|
**wasm32 target has been removed**
|
||||||
|
**mingwX86 target has been removed**
|
||||||
|
|
||||||
|
* `Kotlin`: `1.9.20-RC`
|
||||||
|
|
||||||
## 1.2.1
|
## 1.2.1
|
||||||
|
|
||||||
* `Kotlin`: `1.9.10`
|
* `Kotlin`: `1.9.10`
|
||||||
|
|||||||
39
build.gradle
39
build.gradle
@@ -20,9 +20,29 @@ plugins {
|
|||||||
alias(libs.plugins.kotlin.multiplatform)
|
alias(libs.plugins.kotlin.multiplatform)
|
||||||
alias(libs.plugins.kotlin.dokka)
|
alias(libs.plugins.kotlin.dokka)
|
||||||
alias(libs.plugins.versions)
|
alias(libs.plugins.versions)
|
||||||
|
alias(libs.plugins.nmcp.aggregation)
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: "com.android.library"
|
apply plugin: "com.android.library"
|
||||||
|
apply from: "defaultAndroidSettings.gradle"
|
||||||
|
|
||||||
|
apply from: "github_release.gradle"
|
||||||
|
apply from: "publish.gradle"
|
||||||
|
apply from: "dokka.gradle"
|
||||||
|
|
||||||
|
|
||||||
|
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||||
|
nmcpAggregation {
|
||||||
|
centralPortal {
|
||||||
|
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||||
|
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||||
|
validationTimeout = Duration.ofHours(4)
|
||||||
|
publishingType = System.getenv('PUBLISHING_TYPE') != "" ? System.getenv('PUBLISHING_TYPE') : "USER_MANAGED"
|
||||||
|
}
|
||||||
|
|
||||||
|
publishAllProjectsProbablyBreakingProjectIsolation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
project.version = "$version"
|
project.version = "$version"
|
||||||
project.group = "$group"
|
project.group = "$group"
|
||||||
@@ -45,8 +65,13 @@ kotlin {
|
|||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
android {
|
androidTarget {
|
||||||
publishAllLibraryVariants()
|
publishAllLibraryVariants()
|
||||||
|
compilations.all {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
linuxArm64()
|
linuxArm64()
|
||||||
linuxArm32Hfp()
|
linuxArm32Hfp()
|
||||||
@@ -56,9 +81,7 @@ kotlin {
|
|||||||
nodejs()
|
nodejs()
|
||||||
d8()
|
d8()
|
||||||
}
|
}
|
||||||
wasm32()
|
|
||||||
mingwX64()
|
mingwX64()
|
||||||
mingwX86()
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
commonMain {
|
commonMain {
|
||||||
@@ -70,6 +93,10 @@ kotlin {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation libs.kotlin.test.common
|
implementation libs.kotlin.test.common
|
||||||
implementation libs.kotlin.test.annotations.common
|
implementation libs.kotlin.test.annotations.common
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jvmTest {
|
||||||
|
dependencies {
|
||||||
implementation libs.kotlin.test.junit
|
implementation libs.kotlin.test.junit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,9 +107,3 @@ java {
|
|||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "defaultAndroidSettings.gradle"
|
|
||||||
|
|
||||||
apply from: "github_release.gradle"
|
|
||||||
apply from: "publish.gradle"
|
|
||||||
apply from: "dokka.gradle"
|
|
||||||
|
|||||||
@@ -26,8 +26,9 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileSdkVersion libs.versions.android.compileSdk.get().toInteger()
|
compileSdk libs.versions.android.compileSdk.get().toInteger()
|
||||||
buildToolsVersion libs.versions.android.buildTools.get()
|
buildToolsVersion = libs.versions.android.buildTools.get()
|
||||||
|
namespace "${group}.${project.name}"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion libs.versions.android.minSdk.get().toInteger()
|
minSdkVersion libs.versions.android.minSdk.get().toInteger()
|
||||||
@@ -51,8 +52,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -11,20 +11,28 @@ private String getCurrentVersionChangelog() {
|
|||||||
return changelogDataOS.toString().trim()
|
return changelogDataOS.toString().trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new File(projectDir, "secret.gradle").exists()) {
|
|
||||||
apply from: './secret.gradle'
|
def githubTokenVariableName = "GITHUB_RELEASE_TOKEN"
|
||||||
|
def githubTokenVariableFromEnv = System.getenv(githubTokenVariableName)
|
||||||
|
|
||||||
|
def secretFile = new File(projectDir, "secret.gradle")
|
||||||
|
if (secretFile.exists() || project.hasProperty(githubTokenVariableName) || (githubTokenVariableFromEnv != "" && githubTokenVariableFromEnv != null)) {
|
||||||
|
if (secretFile.exists()) {
|
||||||
|
apply from: './secret.gradle'
|
||||||
|
}
|
||||||
apply plugin: "com.github.breadmoirai.github-release"
|
apply plugin: "com.github.breadmoirai.github-release"
|
||||||
|
def githubReleaseToken = project.hasProperty(githubTokenVariableName) ? project.property(githubTokenVariableName).toString() : githubTokenVariableFromEnv
|
||||||
|
|
||||||
githubRelease {
|
githubRelease {
|
||||||
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
token githubReleaseToken
|
||||||
|
|
||||||
owner "InsanusMokrassar"
|
owner = "InsanusMokrassar"
|
||||||
repo "KSLog"
|
repo = "KSLog"
|
||||||
|
|
||||||
tagName "v${project.version}"
|
tagName = "v${project.version}"
|
||||||
releaseName "${project.version}"
|
releaseName = "${project.version}"
|
||||||
targetCommitish "${project.version}"
|
targetCommitish = "${project.version}"
|
||||||
|
|
||||||
body getCurrentVersionChangelog()
|
body = getCurrentVersionChangelog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ org.gradle.jvmargs=-Xmx512m
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=1.2.1
|
version=1.5.1
|
||||||
android_code_version=23
|
android_code_version=38
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kotlin = "1.9.10"
|
kotlin = "2.2.20"
|
||||||
kotlin-gradle-plugin = "7.4.2"
|
kotlin-gradle-plugin = "8.10.+"
|
||||||
|
|
||||||
versions = "0.47.0"
|
nmcp = "1.2.0"
|
||||||
|
versions = "0.51.0"
|
||||||
|
|
||||||
dokka = "1.9.0"
|
dokka = "2.0.0"
|
||||||
|
|
||||||
dexcount = "4.0.0"
|
dexcount = "4.0.0"
|
||||||
junit_version = "4.12"
|
junit_version = "4.12"
|
||||||
test_ext_junit_version = "1.1.5"
|
test_ext_junit_version = "1.3.0"
|
||||||
espresso_core = "3.5.1"
|
espresso_core = "3.7.0"
|
||||||
|
|
||||||
android-minSdk = "21"
|
android-minSdk = "21"
|
||||||
android-compileSdk = "34"
|
android-compileSdk = "36"
|
||||||
android-buildTools = "34.0.0"
|
android-buildTools = "36.0.0"
|
||||||
|
|
||||||
github-release = "2.4.1"
|
github-release = "2.5.2"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
@@ -42,3 +43,5 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref
|
|||||||
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
|
||||||
|
|
||||||
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
||||||
|
|
||||||
|
nmcp-aggregation = { id = "com.gradleup.nmcp.aggregation", version.ref = "nmcp" }
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
295
gradlew
vendored
295
gradlew
vendored
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright 2015 the original author or authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -15,81 +15,114 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
#
|
||||||
## Gradle start up script for UN*X
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
##
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
# Resolve links: $0 may be a link
|
# Resolve links: $0 may be a link
|
||||||
PRG="$0"
|
app_path=$0
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
# Need this for daisy-chained symlinks.
|
||||||
ls=`ls -ld "$PRG"`
|
while
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
[ -h "$app_path" ]
|
||||||
PRG="$link"
|
do
|
||||||
else
|
ls=$( ls -ld "$app_path" )
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
link=${ls#*' -> '}
|
||||||
fi
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
# This is normally unused
|
||||||
APP_BASE_NAME=`basename "$0"`
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD=maximum
|
||||||
|
|
||||||
warn () {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
die () {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
# OS specific support (must be 'true' or 'false').
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
nonstop=false
|
nonstop=false
|
||||||
case "`uname`" in
|
case "$( uname )" in #(
|
||||||
CYGWIN* )
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
cygwin=true
|
Darwin* ) darwin=true ;; #(
|
||||||
;;
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
Darwin* )
|
NONSTOP* ) nonstop=true ;;
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
else
|
else
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
fi
|
fi
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
@@ -98,88 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD="java"
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
case $MAX_FD in #(
|
||||||
if [ $? -eq 0 ] ; then
|
max*)
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
ulimit -n $MAX_FD
|
warn "Could not query maximum file descriptor limit"
|
||||||
if [ $? -ne 0 ] ; then
|
esac
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
case $MAX_FD in #(
|
||||||
fi
|
'' | soft) :;; #(
|
||||||
else
|
*)
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
fi
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
||||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=`expr $i + 1`
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
0) set -- ;;
|
|
||||||
1) set -- "$args0" ;;
|
|
||||||
2) set -- "$args0" "$args1" ;;
|
|
||||||
3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
save () {
|
# * args from the command line
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
# * the main class name
|
||||||
echo " "
|
# * -classpath
|
||||||
}
|
# * -D...appname settings
|
||||||
APP_ARGS=`save "$@"`
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
|||||||
182
gradlew.bat
vendored
182
gradlew.bat
vendored
@@ -1,89 +1,93 @@
|
|||||||
@rem
|
@rem
|
||||||
@rem Copyright 2015 the original author or authors.
|
@rem Copyright 2015 the original author or authors.
|
||||||
@rem
|
@rem
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@rem you may not use this file except in compliance with the License.
|
@rem you may not use this file except in compliance with the License.
|
||||||
@rem You may obtain a copy of the License at
|
@rem You may obtain a copy of the License at
|
||||||
@rem
|
@rem
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@rem
|
@rem
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
@if "%DEBUG%" == "" @echo off
|
@rem
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem Gradle startup script for Windows
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem ##########################################################################
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
set DIRNAME=%~dp0
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
|
||||||
set APP_BASE_NAME=%~n0
|
set DIRNAME=%~dp0
|
||||||
set APP_HOME=%DIRNAME%
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
set APP_BASE_NAME=%~n0
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
@rem Find java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
echo.
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo. 1>&2
|
||||||
echo location of your Java installation.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
|
echo. 1>&2
|
||||||
goto fail
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
|
echo location of your Java installation. 1>&2
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
goto fail
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
if exist "%JAVA_EXE%" goto execute
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
if exist "%JAVA_EXE%" goto execute
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo. 1>&2
|
||||||
echo location of your Java installation.
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
|
echo. 1>&2
|
||||||
goto fail
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
|
echo location of your Java installation. 1>&2
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
goto fail
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
||||||
|
@rem Execute Gradle
|
||||||
:end
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
:fail
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
:fail
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
exit /b 1
|
rem the _cmd.exe /c_ return code!
|
||||||
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
:mainEnd
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
:omega
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
|
|||||||
121
publish.gradle
121
publish.gradle
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
task javadocsJar(type: Jar) {
|
task javadocsJar(type: Jar) {
|
||||||
classifier = 'javadoc'
|
archiveClassifier = 'javadoc'
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
@@ -19,70 +20,47 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
developers {
|
developers {
|
||||||
|
developer {
|
||||||
developer {
|
id = "Akkihi"
|
||||||
id = "Akkihi"
|
name = "Akkihi"
|
||||||
name = "Akkihi"
|
email = "akkihiguy@gmail.com"
|
||||||
email = "akkihiguy@gmail.com"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
developer {
|
developer {
|
||||||
id = "InsanusMokrassar"
|
id = "InsanusMokrassar"
|
||||||
name = "InsanusMokrassar"
|
name = "InsanusMokrassar"
|
||||||
email = "ovsyannikov.alexey95@gmail.com"
|
email = "ovsyannikov.alexey95@gmail.com"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
licenses {
|
licenses {
|
||||||
|
license {
|
||||||
license {
|
name = "MIT License"
|
||||||
name = "MIT License"
|
url = "https://opensource.org/licenses/MIT"
|
||||||
url = "https://opensource.org/licenses/MIT"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
}
|
||||||
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
|
repositories {
|
||||||
maven {
|
if ((project.hasProperty('INMONEXUS_USER') || System.getenv('INMONEXUS_USER') != null) && (project.hasProperty('INMONEXUS_PASSWORD') || System.getenv('INMONEXUS_PASSWORD') != null)) {
|
||||||
name = "GithubPackages"
|
maven {
|
||||||
url = uri("https://maven.pkg.github.com/InsanusMokrassar/KSLog")
|
name = "InmoNexus"
|
||||||
|
url = uri("https://nexus.inmo.dev/repository/maven-releases/")
|
||||||
credentials {
|
|
||||||
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
|
credentials {
|
||||||
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
|
username = project.hasProperty('INMONEXUS_USER') ? project.property('INMONEXUS_USER') : System.getenv('INMONEXUS_USER')
|
||||||
}
|
password = project.hasProperty('INMONEXUS_PASSWORD') ? project.property('INMONEXUS_PASSWORD') : System.getenv('INMONEXUS_PASSWORD')
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (project.hasProperty('GITEA_TOKEN') || System.getenv('GITEA_TOKEN') != null) {
|
}
|
||||||
maven {
|
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||||
name = "Gitea"
|
maven {
|
||||||
url = uri("https://git.inmo.dev/api/packages/InsanusMokrassar/maven")
|
name = "sonatype"
|
||||||
|
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
|
||||||
credentials(HttpHeaderCredentials) {
|
|
||||||
name = "Authorization"
|
credentials {
|
||||||
value = project.hasProperty('GITEA_TOKEN') ? project.property('GITEA_TOKEN') : System.getenv('GITEA_TOKEN')
|
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||||
}
|
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||||
|
|
||||||
authentication {
|
|
||||||
header(HttpHeaderAuthentication)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
|
||||||
maven {
|
|
||||||
name = "sonatype"
|
|
||||||
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
|
||||||
|
|
||||||
credentials {
|
|
||||||
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
|
||||||
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,16 +69,39 @@ publishing {
|
|||||||
|
|
||||||
if (project.hasProperty("signing.gnupg.keyName")) {
|
if (project.hasProperty("signing.gnupg.keyName")) {
|
||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
useGpgCmd()
|
useGpgCmd()
|
||||||
|
|
||||||
sign publishing.publications
|
sign publishing.publications
|
||||||
}
|
}
|
||||||
|
|
||||||
task signAll {
|
task signAll {
|
||||||
tasks.withType(Sign).forEach {
|
tasks.withType(Sign).forEach {
|
||||||
dependsOn(it)
|
dependsOn(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround to make android sign operations depend on signing tasks
|
||||||
|
project.getTasks().withType(AbstractPublishToMaven.class).configureEach {
|
||||||
|
def signingTasks = project.getTasks().withType(Sign.class)
|
||||||
|
mustRunAfter(signingTasks)
|
||||||
|
}
|
||||||
|
// Workaround to make test tasks use sign
|
||||||
|
project.getTasks().withType(Sign.class).configureEach { signTask ->
|
||||||
|
def withoutSign = (signTask.name.startsWith("sign") ? signTask.name.minus("sign") : signTask.name)
|
||||||
|
def pubName = withoutSign.endsWith("Publication") ? withoutSign.substring(0, withoutSign.length() - "Publication".length()) : withoutSign
|
||||||
|
// These tasks only exist for native targets, hence findByName() to avoid trying to find them for other targets
|
||||||
|
|
||||||
|
// Task ':linkDebugTest<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
|
||||||
|
def debugTestTask = tasks.findByName("linkDebugTest$pubName")
|
||||||
|
if (debugTestTask != null) {
|
||||||
|
signTask.mustRunAfter(debugTestTask)
|
||||||
|
}
|
||||||
|
// Task ':compileTestKotlin<platform>' uses this output of task ':sign<platform>Publication' without declaring an explicit or implicit dependency
|
||||||
|
def testTask = tasks.findByName("compileTestKotlin$pubName")
|
||||||
|
if (testTask != null) {
|
||||||
|
signTask.mustRunAfter(testTask)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"licenses":[{"id":"MIT","title":"MIT License","url":"https://opensource.org/licenses/MIT"}],"mavenConfig":{"name":"${project.name}","description":"Simple logging library for kotlin","url":"https://github.com/InsanusMokrassar/KSLog","vcsUrl":"https://github.com/InsanusMokrassar/KSLog.git","developers":[{"id":"Akkihi","name":"Akkihi","eMail":"akkihiguy@gmail.com"},{"id":"InsanusMokrassar","name":"InsanusMokrassar","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/KSLog"},{"name":"Gitea","url":"https://git.inmo.dev/api/packages/InsanusMokrassar/maven","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.HttpHeaderCredentials","headerName":"Authorization","headerValueProperty":"GITEA_TOKEN"}},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
{"licenses":[{"id":"MIT","title":"MIT License","url":"https://opensource.org/licenses/MIT"}],"mavenConfig":{"name":"${project.name}","description":"Simple logging library for kotlin","url":"https://github.com/InsanusMokrassar/KSLog","vcsUrl":"https://github.com/InsanusMokrassar/KSLog.git","developers":[{"id":"Akkihi","name":"Akkihi","eMail":"akkihiguy@gmail.com"},{"id":"InsanusMokrassar","name":"InsanusMokrassar","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"InmoNexus","url":"https://nexus.inmo.dev/repository/maven-releases/"},{"name":"sonatype","url":"https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
|
||||||
@@ -1,3 +1 @@
|
|||||||
rootProject.name = 'kslog'
|
rootProject.name = 'kslog'
|
||||||
|
|
||||||
enableFeaturePreview("VERSION_CATALOGS")
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<manifest package="dev.inmo.kslog"/>
|
|
||||||
@@ -2,10 +2,10 @@ package dev.inmo.kslog.common
|
|||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
|
||||||
|
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, t, m, e ->
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, t, m, e ->
|
|
||||||
val messageString = m.toString()
|
val messageString = m.toString()
|
||||||
when(l) {
|
when(l) {
|
||||||
|
LogLevel.TRACE -> Log.d(t, messageString, e)
|
||||||
LogLevel.DEBUG -> Log.d(t, messageString, e)
|
LogLevel.DEBUG -> Log.d(t, messageString, e)
|
||||||
LogLevel.VERBOSE -> Log.v(t, messageString, e)
|
LogLevel.VERBOSE -> Log.v(t, messageString, e)
|
||||||
LogLevel.INFO -> Log.i(t, messageString, e)
|
LogLevel.INFO -> Log.i(t, messageString, e)
|
||||||
@@ -13,4 +13,4 @@ internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any,
|
|||||||
LogLevel.ERROR -> Log.e(t, messageString, e)
|
LogLevel.ERROR -> Log.e(t, messageString, e)
|
||||||
LogLevel.ASSERT -> Log.wtf(t, messageString, e)
|
LogLevel.ASSERT -> Log.wtf(t, messageString, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,20 @@
|
|||||||
package dev.inmo.kslog.common
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creating base tag using class simple name of receiver
|
||||||
|
*
|
||||||
|
* @throws IllegalStateException If there is no opportunity to take simple name of receiver class
|
||||||
|
*/
|
||||||
val Any.logTag
|
val Any.logTag
|
||||||
get() = this::class.simpleName ?: error("Unable to retrieve log tag")
|
get() = this::class.simpleName ?: error("Unable to retrieve log tag")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creating [TagLogger] with [logTag] as base tag
|
||||||
|
*/
|
||||||
val Any.logger: KSLog
|
val Any.logger: KSLog
|
||||||
get() = TagLogger(logTag)
|
get() = TagLogger(logTag)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creating [TagLogger] using [logger] extension property with [tagBase] as `this`
|
||||||
|
*/
|
||||||
fun taggedLogger(tagBase: Any): KSLog = tagBase.logger
|
fun taggedLogger(tagBase: Any): KSLog = tagBase.logger
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
package dev.inmo.kslog.common
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
|
import kotlin.jvm.JvmInline
|
||||||
|
|
||||||
typealias SimpleKSLogCallback = (level: LogLevel, tag: String?, message: Any, throwable: Throwable?) -> Unit
|
typealias SimpleKSLogCallback = (level: LogLevel, tag: String?, message: Any, throwable: Throwable?) -> Unit
|
||||||
|
|
||||||
class CallbackKSLog(
|
/**
|
||||||
|
* Creates simple [KSLog] which will pass all incoming [performLog] calls to [performLogCallback]
|
||||||
|
*/
|
||||||
|
@JvmInline
|
||||||
|
value class CallbackKSLog(
|
||||||
private val performLogCallback: SimpleKSLogCallback
|
private val performLogCallback: SimpleKSLogCallback
|
||||||
) : KSLog {
|
) : KSLog {
|
||||||
override fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?) = performLogCallback(level, tag, message, throwable)
|
override fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?) = performLogCallback(level, tag, message, throwable)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creating [CallbackKSLog] using [performLogCallback] as an argument for constructor
|
||||||
|
*/
|
||||||
fun KSLog(
|
fun KSLog(
|
||||||
performLogCallback: SimpleKSLogCallback
|
performLogCallback: SimpleKSLogCallback
|
||||||
) = CallbackKSLog(performLogCallback)
|
) = CallbackKSLog(performLogCallback)
|
||||||
|
|||||||
@@ -2,23 +2,32 @@ package dev.inmo.kslog.common
|
|||||||
|
|
||||||
import dev.inmo.kslog.common.filter.filtered
|
import dev.inmo.kslog.common.filter.filtered
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logger based on [KSLoggerDefaultPlatformLoggerLambda] or [logging] parameter
|
||||||
|
*
|
||||||
|
* @param defaultTag will be used in case when `tag` parameter in [performLog] omitted
|
||||||
|
* @param messageFormatter special formatter which creating [String] inside of [performLog] for each call. Defaults to
|
||||||
|
* [defaultMessageFormatter]
|
||||||
|
* @param logging target lambda which will be called with a result of [messageFormatter] logs formatting as a message
|
||||||
|
* and tag as tag if not `null` and [defaultTag] otherwise
|
||||||
|
*/
|
||||||
class DefaultKSLog(
|
class DefaultKSLog(
|
||||||
private val defaultTag: String,
|
private val defaultTag: String,
|
||||||
private val messageFormatter: MessageFormatter = defaultMessageFormatter,
|
private val messageFormatter: MessageFormatter = defaultMessageFormatter,
|
||||||
private val logging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = defaultLogging
|
private val logging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = KSLoggerDefaultPlatformLoggerLambda
|
||||||
) : KSLog {
|
) : KSLog {
|
||||||
override fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?) {
|
override fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?) {
|
||||||
val tag = tag ?: defaultTag
|
val resultTag = tag ?: defaultTag
|
||||||
|
|
||||||
val text = messageFormatter(level, tag, message, throwable)
|
val text = messageFormatter(level, resultTag, message, throwable)
|
||||||
logging(level, tag, text, throwable)
|
logging(level, resultTag, text, throwable)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun performLog(level: LogLevel, tag: String?, throwable: Throwable?, messageBuilder: () -> Any) {
|
override fun performLog(level: LogLevel, tag: String?, throwable: Throwable?, messageBuilder: () -> Any) {
|
||||||
val tag = tag ?: defaultTag
|
val resultTag = tag ?: defaultTag
|
||||||
|
|
||||||
val text = messageFormatter(level, tag, messageBuilder(), throwable)
|
val text = messageFormatter(level, resultTag, messageBuilder(), throwable)
|
||||||
logging(level, tag, text, throwable)
|
logging(level, resultTag, text, throwable)
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun performLogS(
|
override suspend fun performLogS(
|
||||||
@@ -27,10 +36,10 @@ class DefaultKSLog(
|
|||||||
throwable: Throwable?,
|
throwable: Throwable?,
|
||||||
messageBuilder: suspend () -> Any
|
messageBuilder: suspend () -> Any
|
||||||
) {
|
) {
|
||||||
val tag = tag ?: defaultTag
|
val resultTag = tag ?: defaultTag
|
||||||
|
|
||||||
val text = messageFormatter(level, tag, messageBuilder(), throwable)
|
val text = messageFormatter(level, resultTag, messageBuilder(), throwable)
|
||||||
logging(level, tag, text, throwable)
|
logging(level, resultTag, text, throwable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +48,7 @@ fun DefaultKSLog(
|
|||||||
defaultTag: String,
|
defaultTag: String,
|
||||||
filter: MessageFilter = { _, _, _ -> true },
|
filter: MessageFilter = { _, _, _ -> true },
|
||||||
messageFormatter: MessageFormatter = defaultMessageFormatter,
|
messageFormatter: MessageFormatter = defaultMessageFormatter,
|
||||||
logging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = defaultLogging
|
logging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = KSLoggerDefaultPlatformLoggerLambda
|
||||||
) = DefaultKSLog(
|
) = DefaultKSLog(
|
||||||
defaultTag, messageFormatter, logging
|
defaultTag, messageFormatter, logging
|
||||||
).filtered(filter)
|
).filtered(filter)
|
||||||
|
|||||||
@@ -15,6 +15,19 @@ inline fun KSLog.log(level: LogLevel, tag: String, message: Any, e: Throwable?)
|
|||||||
inline fun KSLog.log(level: LogLevel, tag: String, message: Any) = performLog(level, tag, message, null)
|
inline fun KSLog.log(level: LogLevel, tag: String, message: Any) = performLog(level, tag, message, null)
|
||||||
|
|
||||||
|
|
||||||
|
inline fun KSLog.trace(e: Throwable? = null, noinline messageBuilder: () -> Any) = log(LogLevel.TRACE, null, e, messageBuilder)
|
||||||
|
inline fun KSLog.trace(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any) = log(LogLevel.TRACE, tag, e, messageBuilder)
|
||||||
|
inline fun KSLog.trace(tag: String, noinline messageBuilder: () -> Any) = trace(tag, null, messageBuilder)
|
||||||
|
suspend inline fun KSLog.traceS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any) = logS(LogLevel.TRACE, null, e, messageBuilder)
|
||||||
|
suspend inline fun KSLog.traceS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any) = logS(LogLevel.TRACE, tag, e, messageBuilder)
|
||||||
|
suspend inline fun KSLog.traceS(tag: String, noinline messageBuilder: suspend () -> Any) = traceS(tag, null, messageBuilder)
|
||||||
|
inline fun KSLog.trace(message: Any, e: Throwable?) = log(LogLevel.TRACE, message, e)
|
||||||
|
inline fun KSLog.trace(message: String, e: Throwable) = trace(message as Any, e)
|
||||||
|
inline fun KSLog.trace(message: Any) = trace(message, null)
|
||||||
|
inline fun KSLog.trace(tag: String, message: Any, e: Throwable?) = log(LogLevel.TRACE, tag, message, e)
|
||||||
|
inline fun KSLog.trace(tag: String, message: Any) = trace(tag, message, null)
|
||||||
|
|
||||||
|
|
||||||
inline fun KSLog.debug(e: Throwable? = null, noinline messageBuilder: () -> Any) = log(LogLevel.DEBUG, null, e, messageBuilder)
|
inline fun KSLog.debug(e: Throwable? = null, noinline messageBuilder: () -> Any) = log(LogLevel.DEBUG, null, e, messageBuilder)
|
||||||
inline fun KSLog.debug(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any) = log(LogLevel.DEBUG, tag, e, messageBuilder)
|
inline fun KSLog.debug(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any) = log(LogLevel.DEBUG, tag, e, messageBuilder)
|
||||||
inline fun KSLog.debug(tag: String, noinline messageBuilder: () -> Any) = debug(tag, null, messageBuilder)
|
inline fun KSLog.debug(tag: String, noinline messageBuilder: () -> Any) = debug(tag, null, messageBuilder)
|
||||||
@@ -108,6 +121,19 @@ inline fun KSLog.l(level: LogLevel, tag: String, message: Any, e: Throwable?) =
|
|||||||
inline fun KSLog.l(level: LogLevel, tag: String, message: Any) = log(level, tag, message, null)
|
inline fun KSLog.l(level: LogLevel, tag: String, message: Any) = log(level, tag, message, null)
|
||||||
|
|
||||||
|
|
||||||
|
inline fun KSLog.t(e: Throwable? = null, noinline messageBuilder: () -> Any) = trace(e, messageBuilder)
|
||||||
|
inline fun KSLog.t(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any) = trace(tag, e, messageBuilder)
|
||||||
|
inline fun KSLog.t(tag: String, noinline messageBuilder: () -> Any) = t(tag, null, messageBuilder)
|
||||||
|
suspend inline fun KSLog.tS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any) = traceS(e, messageBuilder)
|
||||||
|
suspend inline fun KSLog.tS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any) = traceS(tag, e, messageBuilder)
|
||||||
|
suspend inline fun KSLog.tS(tag: String, noinline messageBuilder: suspend () -> Any) = tS(tag, null, messageBuilder)
|
||||||
|
inline fun KSLog.t(message: Any, e: Throwable?) = trace(message, e)
|
||||||
|
inline fun KSLog.t(message: String, e: Throwable) = t(message as Any, e)
|
||||||
|
inline fun KSLog.t(message: Any) = t(message, null)
|
||||||
|
inline fun KSLog.t(tag: String, message: Any, e: Throwable?) = trace(tag, message, e)
|
||||||
|
inline fun KSLog.t(tag: String, message: Any) = t(tag, message, null)
|
||||||
|
|
||||||
|
|
||||||
inline fun KSLog.d(e: Throwable? = null, noinline messageBuilder: () -> Any) = debug(e, messageBuilder)
|
inline fun KSLog.d(e: Throwable? = null, noinline messageBuilder: () -> Any) = debug(e, messageBuilder)
|
||||||
inline fun KSLog.d(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any) = debug(tag, e, messageBuilder)
|
inline fun KSLog.d(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any) = debug(tag, e, messageBuilder)
|
||||||
inline fun KSLog.d(tag: String, noinline messageBuilder: () -> Any) = d(tag, null, messageBuilder)
|
inline fun KSLog.d(tag: String, noinline messageBuilder: () -> Any) = d(tag, null, messageBuilder)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import dev.inmo.kslog.common.utils.plus
|
|||||||
|
|
||||||
|
|
||||||
enum class LogLevel {
|
enum class LogLevel {
|
||||||
|
TRACE,
|
||||||
DEBUG,
|
DEBUG,
|
||||||
VERBOSE,
|
VERBOSE,
|
||||||
INFO,
|
INFO,
|
||||||
@@ -13,15 +14,38 @@ enum class LogLevel {
|
|||||||
ASSERT,
|
ASSERT,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base interface for any logger
|
||||||
|
*
|
||||||
|
* @see default
|
||||||
|
*
|
||||||
|
*/
|
||||||
interface KSLog {
|
interface KSLog {
|
||||||
|
/**
|
||||||
|
* The only one function required to realization in any inheritor. All other [performLog] functions
|
||||||
|
* will call this one by default
|
||||||
|
*/
|
||||||
fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?)
|
fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls default [performLog] with `tag` == `null`
|
||||||
|
*/
|
||||||
fun performLog(level: LogLevel, message: Any, throwable: Throwable?) = performLog(level, null, message, throwable)
|
fun performLog(level: LogLevel, message: Any, throwable: Throwable?) = performLog(level, null, message, throwable)
|
||||||
|
/**
|
||||||
|
* Calls default [performLog] with `message` built using [messageBuilder]. This method supposed to be overriden in
|
||||||
|
* case when logger supports lazy-loaded messages (like [dev.inmo.kslog.common.filter.FilterKSLog])
|
||||||
|
*/
|
||||||
fun performLog(
|
fun performLog(
|
||||||
level: LogLevel,
|
level: LogLevel,
|
||||||
tag: String?,
|
tag: String?,
|
||||||
throwable: Throwable?,
|
throwable: Throwable?,
|
||||||
messageBuilder: () -> Any
|
messageBuilder: () -> Any
|
||||||
) = performLog(level, tag, messageBuilder(), throwable)
|
) = performLog(level, tag, messageBuilder(), throwable)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Suspendable variant of [performLog] with [messageBuilder]. Uses default [performLog] with `message` built using
|
||||||
|
* [messageBuilder] by default
|
||||||
|
*/
|
||||||
suspend fun performLogS(
|
suspend fun performLogS(
|
||||||
level: LogLevel,
|
level: LogLevel,
|
||||||
tag: String?,
|
tag: String?,
|
||||||
@@ -32,6 +56,10 @@ interface KSLog {
|
|||||||
|
|
||||||
companion object : KSLog {
|
companion object : KSLog {
|
||||||
private var defaultLogger: KSLog? = null
|
private var defaultLogger: KSLog? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default logger used in case you are trying to use [KSLog] as a receiver for extensions like [info]
|
||||||
|
*/
|
||||||
var default: KSLog
|
var default: KSLog
|
||||||
get() {
|
get() {
|
||||||
return defaultLogger ?: KSLog("app").also {
|
return defaultLogger ?: KSLog("app").also {
|
||||||
@@ -61,15 +89,20 @@ interface KSLog {
|
|||||||
|
|
||||||
operator fun KSLog.invoke(performLogCallback: (level: LogLevel, tag: String?, message: Any, throwable: Throwable?) -> Unit) = CallbackKSLog(performLogCallback)
|
operator fun KSLog.invoke(performLogCallback: (level: LogLevel, tag: String?, message: Any, throwable: Throwable?) -> Unit) = CallbackKSLog(performLogCallback)
|
||||||
|
|
||||||
internal expect val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
|
||||||
internal val printlnLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, t, m, e ->
|
internal val printlnLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, t, m, e ->
|
||||||
println(defaultMessageFormatter(l, t, m, e))
|
println(defaultMessageFormatter(l, t, m, e))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple builder for [DefaultKSLog] logger based on [defaultTag]
|
||||||
|
*/
|
||||||
fun KSLog(
|
fun KSLog(
|
||||||
defaultTag: String,
|
defaultTag: String,
|
||||||
): KSLog = DefaultKSLog(defaultTag)
|
): KSLog = DefaultKSLog(defaultTag)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple builder for [DefaultKSLog] logger based on [defaultTag] and [messageFormatter]
|
||||||
|
*/
|
||||||
fun KSLog(
|
fun KSLog(
|
||||||
defaultTag: String,
|
defaultTag: String,
|
||||||
messageFormatter: MessageFormatter
|
messageFormatter: MessageFormatter
|
||||||
@@ -88,17 +121,25 @@ fun KSLog(
|
|||||||
messageFormatter
|
messageFormatter
|
||||||
).filtered(filter)
|
).filtered(filter)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Building logger using [KSLog] builder based on [defaultTag] and [messageFormatter]. This logger will also filter
|
||||||
|
* incoming levels: only levels passed in [levels] param will be logged
|
||||||
|
*/
|
||||||
fun KSLog(
|
fun KSLog(
|
||||||
defaultTag: String,
|
defaultTag: String,
|
||||||
levels: Iterable<LogLevel>,
|
levels: Iterable<LogLevel>,
|
||||||
messageFormatter: MessageFormatter = defaultMessageFormatter
|
messageFormatter: MessageFormatter = defaultMessageFormatter
|
||||||
): KSLog {
|
): KSLog {
|
||||||
val levels = levels.toSet()
|
val levelsSet = levels.toSet()
|
||||||
return KSLog (defaultTag, messageFormatter).filtered { l, _, _ ->
|
return KSLog (defaultTag, messageFormatter).filtered { l, _, _ ->
|
||||||
l in levels
|
l in levelsSet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Building logger using [KSLog] builder based on [defaultTag] and [messageFormatter]. This logger will also filter
|
||||||
|
* incoming levels: only levels passed in [firstLevel], [secondLevel] and [otherLevels] param will be logged
|
||||||
|
*/
|
||||||
fun KSLog(
|
fun KSLog(
|
||||||
defaultTag: String,
|
defaultTag: String,
|
||||||
firstLevel: LogLevel,
|
firstLevel: LogLevel,
|
||||||
@@ -107,6 +148,10 @@ fun KSLog(
|
|||||||
messageFormatter: MessageFormatter = defaultMessageFormatter,
|
messageFormatter: MessageFormatter = defaultMessageFormatter,
|
||||||
): KSLog = KSLog(defaultTag, setOf(firstLevel, secondLevel, *otherLevels), messageFormatter)
|
): KSLog = KSLog(defaultTag, setOf(firstLevel, secondLevel, *otherLevels), messageFormatter)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Building logger using [KSLog] builder based on [defaultTag] and [messageFormatter]. This logger will also filter
|
||||||
|
* incoming levels: only levels above [minLoggingLevel] will be logged
|
||||||
|
*/
|
||||||
fun KSLog(
|
fun KSLog(
|
||||||
defaultTag: String,
|
defaultTag: String,
|
||||||
minLoggingLevel: LogLevel,
|
minLoggingLevel: LogLevel,
|
||||||
@@ -118,5 +163,13 @@ fun KSLog(
|
|||||||
minLoggingLevel.ordinal <= l.ordinal
|
minLoggingLevel.ordinal <= l.ordinal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setting [KSLog.default] logger to [newDefault]
|
||||||
|
*/
|
||||||
fun setDefaultKSLog(newDefault: KSLog) { KSLog.default = newDefault }
|
fun setDefaultKSLog(newDefault: KSLog) { KSLog.default = newDefault }
|
||||||
fun addDefaultKSLog(newDefault: KSLog) { KSLog.default = KSLog.default + newDefault }
|
/**
|
||||||
|
* Setting [KSLog.default] logger to new [CallbackKSLog] using [plus] operation
|
||||||
|
*/
|
||||||
|
fun addDefaultKSLog(newDefault: KSLog) {
|
||||||
|
KSLog.default += newDefault
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package dev.inmo.kslog.common
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
typealias MessageFormatter = (l: LogLevel, t: String?, m: Any, Throwable?) -> String
|
typealias MessageFormatter = (l: LogLevel, t: String?, m: Any, Throwable?) -> String
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
|
||||||
inline fun MessageFormatter(noinline formatter: MessageFormatter) = formatter
|
inline fun MessageFormatter(noinline formatter: MessageFormatter) = formatter
|
||||||
typealias MessageFilter = (l: LogLevel, t: String?, Throwable?) -> Boolean
|
typealias MessageFilter = (l: LogLevel, t: String?, Throwable?) -> Boolean
|
||||||
val defaultMessageFormatter: MessageFormatter = { l, t, m, _ -> "[$l] ${t ?.let { "$it " } ?: ""}- $m" }
|
val defaultMessageFormatter: MessageFormatter = { l, t, m, _ -> "[$l] ${t ?.let { "$it " } ?: ""}- $m" }
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default logger for current platform. You may change it, but you should remember that it is global logger
|
||||||
|
* used in [KSLog.default] by default
|
||||||
|
*/
|
||||||
|
expect var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
||||||
@@ -2,6 +2,9 @@ package dev.inmo.kslog.common
|
|||||||
|
|
||||||
import kotlin.jvm.JvmInline
|
import kotlin.jvm.JvmInline
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logger which will use [tag] as default one in cases when [performLog] have `null` tag
|
||||||
|
*/
|
||||||
@JvmInline
|
@JvmInline
|
||||||
value class TagLogger(val tag: String) : KSLog {
|
value class TagLogger(val tag: String) : KSLog {
|
||||||
override fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?) {
|
override fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?) {
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ package dev.inmo.kslog.common.filter
|
|||||||
|
|
||||||
import dev.inmo.kslog.common.*
|
import dev.inmo.kslog.common.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In its [performLog]/[performLogS] methods do logging only in cases when [messageFilter] returns true for incoming
|
||||||
|
* parameters
|
||||||
|
*/
|
||||||
class FilterKSLog(
|
class FilterKSLog(
|
||||||
private val fallbackLogger: KSLog,
|
private val fallbackLogger: KSLog,
|
||||||
private val messageFilter: MessageFilter
|
private val messageFilter: MessageFilter
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package dev.inmo.kslog.common.filter
|
|||||||
import dev.inmo.kslog.common.KSLog
|
import dev.inmo.kslog.common.KSLog
|
||||||
import dev.inmo.kslog.common.MessageFilter
|
import dev.inmo.kslog.common.MessageFilter
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates [FilterKSLog] with applying of [filter] to it
|
||||||
|
*/
|
||||||
fun KSLog.filtered(
|
fun KSLog.filtered(
|
||||||
filter: MessageFilter
|
filter: MessageFilter
|
||||||
) = FilterKSLog(this, filter)
|
) = FilterKSLog(this, filter)
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ package dev.inmo.kslog.common.typed
|
|||||||
import dev.inmo.kslog.common.*
|
import dev.inmo.kslog.common.*
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uses [typedLoggers] [Map] to determine, where incoming __message__s should be sent. If there is no [KClass] key for
|
||||||
|
* incoming message in [typedLoggers], logger will use logger by `null` key if exists. If there is no default logger
|
||||||
|
* (by `null` key), logging will be skipped
|
||||||
|
*/
|
||||||
class TypedKSLog(
|
class TypedKSLog(
|
||||||
private val typedLoggers: Map<KClass<*>?, KSLog>
|
private val typedLoggers: Map<KClass<*>?, KSLog>
|
||||||
) : KSLog {
|
) : KSLog {
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package dev.inmo.kslog.common.typed
|
|||||||
import dev.inmo.kslog.common.*
|
import dev.inmo.kslog.common.*
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Special builder for [TypedKSLog]
|
||||||
|
*/
|
||||||
class TypedKSLogBuilder(
|
class TypedKSLogBuilder(
|
||||||
private val preset: Map<KClass<*>?, KSLog> = emptyMap()
|
private val preset: Map<KClass<*>?, KSLog> = emptyMap()
|
||||||
) {
|
) {
|
||||||
@@ -22,6 +25,9 @@ class TypedKSLogBuilder(
|
|||||||
fun build() = TypedKSLog(loggers.toMap())
|
fun build() = TypedKSLog(loggers.toMap())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DSL for [TypedKSLogBuilder]
|
||||||
|
*/
|
||||||
inline fun buildTypedLogger(
|
inline fun buildTypedLogger(
|
||||||
preset: Map<KClass<*>?, KSLog> = emptyMap(),
|
preset: Map<KClass<*>?, KSLog> = emptyMap(),
|
||||||
block: TypedKSLogBuilder.() -> Unit
|
block: TypedKSLogBuilder.() -> Unit
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ package dev.inmo.kslog.common.utils
|
|||||||
import dev.inmo.kslog.common.CallbackKSLog
|
import dev.inmo.kslog.common.CallbackKSLog
|
||||||
import dev.inmo.kslog.common.KSLog
|
import dev.inmo.kslog.common.KSLog
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will send [KSLog.performLog] of both [this] and [other] [KSLog] instances. In case when [this] will throw exception
|
||||||
|
* result logger will rethrow it. After it, if [other] will throw exception - will also rethrow it
|
||||||
|
*/
|
||||||
infix operator fun KSLog.plus(other: KSLog) = CallbackKSLog { l, t, m, e ->
|
infix operator fun KSLog.plus(other: KSLog) = CallbackKSLog { l, t, m, e ->
|
||||||
val resultOfFirst = runCatching {
|
val resultOfFirst = runCatching {
|
||||||
this@plus.performLog(l, t, m, e)
|
this@plus.performLog(l, t, m, e)
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
package dev.inmo.kslog.common
|
|
||||||
|
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, t, m, e ->
|
|
||||||
val args = e ?.let {
|
|
||||||
arrayOf(m, e)
|
|
||||||
} ?: arrayOf(m)
|
|
||||||
when (l) {
|
|
||||||
LogLevel.DEBUG -> console.log(*args)
|
|
||||||
LogLevel.VERBOSE,
|
|
||||||
LogLevel.INFO -> console.info(*args)
|
|
||||||
LogLevel.WARNING -> console.warn(*args)
|
|
||||||
LogLevel.ERROR,
|
|
||||||
LogLevel.ASSERT -> console.error(*args)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
24
src/jsMain/kotlin/ExtendedConsole.kt
Normal file
24
src/jsMain/kotlin/ExtendedConsole.kt
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
|
import kotlin.js.Console
|
||||||
|
|
||||||
|
external interface ExtendedConsole : Console {
|
||||||
|
fun trace()
|
||||||
|
fun debug(vararg o: Any?)
|
||||||
|
fun assert(assertion: Boolean, vararg o: Any?)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [https://developer.mozilla.org/en-US/docs/Web/API/console/debug_static](https://developer.mozilla.org/en-US/docs/Web/API/console/debug_static)
|
||||||
|
*/
|
||||||
|
fun Console.debug(vararg args: Any?) = unsafeCast<ExtendedConsole>().debug(*args)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [https://developer.mozilla.org/en-US/docs/Web/APtraceI/console/assert_static](https://developer.mozilla.org/en-US/docs/Web/API/console/assert_static)
|
||||||
|
*/
|
||||||
|
fun Console.assert(assertion: Boolean, vararg args: Any?) = unsafeCast<ExtendedConsole>().assert(assertion, *args)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static](https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static)
|
||||||
|
*/
|
||||||
|
fun Console.trace() = unsafeCast<ExtendedConsole>().trace()
|
||||||
19
src/jsMain/kotlin/KSLoggerDefaultPlatformLoggerLambda.kt
Normal file
19
src/jsMain/kotlin/KSLoggerDefaultPlatformLoggerLambda.kt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
|
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, _, m, e ->
|
||||||
|
val args = e ?.let {
|
||||||
|
arrayOf(m, e)
|
||||||
|
} ?: arrayOf(m)
|
||||||
|
when (l) {
|
||||||
|
LogLevel.TRACE -> {
|
||||||
|
console.trace()
|
||||||
|
console.debug(*args)
|
||||||
|
}
|
||||||
|
LogLevel.DEBUG -> console.debug(*args)
|
||||||
|
LogLevel.VERBOSE,
|
||||||
|
LogLevel.INFO -> console.info(*args)
|
||||||
|
LogLevel.WARNING -> console.warn(*args)
|
||||||
|
LogLevel.ERROR -> console.error(*args)
|
||||||
|
LogLevel.ASSERT -> console.error(*args)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,14 +4,15 @@ import dev.inmo.kslog.common.filter.filtered
|
|||||||
import java.util.logging.Level
|
import java.util.logging.Level
|
||||||
import java.util.logging.Logger
|
import java.util.logging.Logger
|
||||||
|
|
||||||
private val defaultKSLogLogger by lazy {
|
internal val defaultKSLogLogger by lazy {
|
||||||
Logger.getLogger("KSLog")
|
Logger.getLogger("KSLog")
|
||||||
}
|
}
|
||||||
private fun Logger.doLog(
|
internal fun Logger.doLog(
|
||||||
l: LogLevel, t: String, m: String, e: Throwable?
|
l: LogLevel, t: String, m: String, e: Throwable?
|
||||||
) = log(
|
) = log(
|
||||||
when(l) {
|
when(l) {
|
||||||
LogLevel.DEBUG -> Level.FINEST
|
LogLevel.TRACE -> Level.FINEST
|
||||||
|
LogLevel.DEBUG -> Level.FINER
|
||||||
LogLevel.VERBOSE -> Level.FINE
|
LogLevel.VERBOSE -> Level.FINE
|
||||||
LogLevel.INFO -> Level.INFO
|
LogLevel.INFO -> Level.INFO
|
||||||
LogLevel.WARNING -> Level.WARNING
|
LogLevel.WARNING -> Level.WARNING
|
||||||
@@ -21,9 +22,6 @@ private fun Logger.doLog(
|
|||||||
m,
|
m,
|
||||||
e
|
e
|
||||||
)
|
)
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, t, m, e ->
|
|
||||||
defaultKSLogLogger.doLog(l, t, m.toString(), e)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated("Filtering should be replaced with FilterKSLog")
|
@Deprecated("Filtering should be replaced with FilterKSLog")
|
||||||
fun KSLog(
|
fun KSLog(
|
||||||
@@ -52,8 +50,8 @@ fun KSLog(
|
|||||||
levels: Iterable<LogLevel>,
|
levels: Iterable<LogLevel>,
|
||||||
messageFormatter: MessageFormatter = defaultMessageFormatter
|
messageFormatter: MessageFormatter = defaultMessageFormatter
|
||||||
): KSLog {
|
): KSLog {
|
||||||
val levels = levels.toSet()
|
val levelsSet = levels.toSet()
|
||||||
return KSLog (defaultTag, logger, messageFormatter).filtered { l, _, _ -> l in levels }
|
return KSLog (defaultTag, logger, messageFormatter).filtered { l, _, _ -> l in levelsSet }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun KSLog(
|
fun KSLog(
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
|
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = { l, t, m, e ->
|
||||||
|
defaultKSLogLogger.doLog(l, t, m.toString(), e)
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package dev.inmo.kslog.common
|
|
||||||
|
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
|
||||||
get() = printlnLogging
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package dev.inmo.kslog.common
|
|
||||||
|
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
|
||||||
get() = printlnLogging
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package dev.inmo.kslog.common
|
|
||||||
|
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
|
||||||
get() = printlnLogging
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package dev.inmo.kslog.common
|
|
||||||
|
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
|
||||||
get() = printlnLogging
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package dev.inmo.kslog.common
|
|
||||||
|
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
|
||||||
get() = printlnLogging
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
|
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit =
|
||||||
|
printlnLogging
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package dev.inmo.kslog.common
|
|
||||||
|
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
|
||||||
get() = printlnLogging
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package dev.inmo.kslog.common
|
||||||
|
|
||||||
|
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit =
|
||||||
|
printlnLogging
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package dev.inmo.kslog.common
|
|
||||||
|
|
||||||
internal actual val defaultLogging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
|
|
||||||
get() = printlnLogging
|
|
||||||
Reference in New Issue
Block a user