Skip to content

Commit

Permalink
revert: remove @feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tangcent committed Nov 3, 2024
1 parent a6ebeab commit 5a63f21
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 831 deletions.
12 changes: 0 additions & 12 deletions commons/src/main/kotlin/com/itangcent/common/logger/ILogger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,16 @@ interface ILogger {
fun error(msg: String)
}

@Deprecated("use traceWarn(e: Throwable, msg: String) instead")
fun ILogger.traceWarn(msg: String, e: Throwable) {
this.warn(msg)
this.traceError(e)
}

fun ILogger.traceWarn(e: Throwable, msg: String) {
this.warn(msg)
this.traceError(e)
}

@Deprecated("use traceError(e: Throwable, msg: String) instead")
fun ILogger.traceError(msg: String, e: Throwable) {
this.error(msg)
this.traceError(e)
}

fun ILogger.traceError(e: Throwable, msg: String) {
this.error(msg)
this.traceError(e)
}

fun ILogger.traceError(e: Throwable) {
if (e !is ProcessCanceledException) {
this.trace(ExceptionUtils.getStackTrace(e))
Expand Down
2 changes: 2 additions & 0 deletions commons/src/main/kotlin/com/itangcent/common/spi/Setup.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.itangcent.common.spi

import com.itangcent.common.logger.ILogger
import com.itangcent.common.logger.ILoggerProvider
import com.itangcent.common.logger.Log
import com.itangcent.common.logger.traceError
import java.util.*
Expand Down
5 changes: 0 additions & 5 deletions commons/src/main/kotlin/com/itangcent/common/spi/SpiUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ object SpiUtils {
loadStack.get().pop()
}
}

fun clearCache() {
serviceCache.clear()
serviceUltimateBeanCache.clear()
}
}

//background idea log
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.itangcent.common.logger.Log
import com.itangcent.common.logger.traceError
import java.io.IOException
import java.io.StringReader
import java.lang.reflect.Type
import kotlin.reflect.KClass


Expand All @@ -30,7 +29,7 @@ object GsonUtils : Log() {
.setLenient()
.buildWithObjectToNumberStrategy()
} catch (e: Exception) {
LOG.traceError(e, "failed init GSON module [gson].")
LOG.traceError("failed init GSON module [gson].", e)
Gson()
}
}
Expand All @@ -45,7 +44,7 @@ object GsonUtils : Log() {
.serializeNulls()
.buildWithObjectToNumberStrategy()
} catch (e: Exception) {
LOG.traceError(e, "failed init GSON module [gsonWithNulls].")
LOG.traceError("failed init GSON module [gsonWithNulls].", e)
Gson()
}
}
Expand Down Expand Up @@ -108,10 +107,6 @@ object GsonUtils : Log() {
return gson.fromJson(json, cls.java)
}

fun <T> fromJson(json: String, type: Type): T {
return gson.fromJson(json, type)
}

inline fun <reified T> fromJson(json: String): T? {
return fromJson(json, T::class.java)
}
Expand Down
Loading

0 comments on commit 5a63f21

Please sign in to comment.