diff --git a/commons-core/pom.xml b/commons-core/pom.xml index 2de377e..4782f87 100644 --- a/commons-core/pom.xml +++ b/commons-core/pom.xml @@ -7,11 +7,11 @@ ru.sokomishalov.commons commons-parent - 1.0.25 + 1.0.26 commons-core - 1.0.25 + 1.0.26 1.3.61 diff --git a/commons-core/src/main/kotlin/ru/sokomishalov/commons/core/log/Sl4jExtensions.kt b/commons-core/src/main/kotlin/ru/sokomishalov/commons/core/log/Sl4jExtensions.kt index 2cfc057..0dce1c2 100644 --- a/commons-core/src/main/kotlin/ru/sokomishalov/commons/core/log/Sl4jExtensions.kt +++ b/commons-core/src/main/kotlin/ru/sokomishalov/commons/core/log/Sl4jExtensions.kt @@ -1,3 +1,18 @@ +/** + * Copyright 2019-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package ru.sokomishalov.commons.core.log import org.slf4j.Logger @@ -6,12 +21,12 @@ import org.slf4j.Logger * @author sokomishalov */ -fun Logger.info(lazyMessage: () -> String) = info(lazyMessage()) +fun Logger.info(lazyMessage: () -> String) = if (isInfoEnabled) info(lazyMessage()) else Unit -fun Logger.debug(lazyMessage: () -> String) = debug(lazyMessage()) +fun Logger.debug(lazyMessage: () -> String) = if (isDebugEnabled) debug(lazyMessage()) else Unit -fun Logger.warn(lazyMessage: () -> String) = warn(lazyMessage()) +fun Logger.warn(lazyMessage: () -> String) = if (isWarnEnabled) warn(lazyMessage()) else Unit -fun Logger.trace(lazyMessage: () -> String) = trace(lazyMessage()) +fun Logger.trace(lazyMessage: () -> String) = if (isTraceEnabled) trace(lazyMessage()) else Unit -fun Logger.error(throwable: Throwable, lazyMessage: () -> String) = error(lazyMessage(), throwable) \ No newline at end of file +fun Logger.error(throwable: Throwable, lazyMessage: () -> String) = if (isErrorEnabled) error(lazyMessage(), throwable) else Unit \ No newline at end of file diff --git a/commons-spring/pom.xml b/commons-spring/pom.xml index 0a7dc35..7c52e95 100644 --- a/commons-spring/pom.xml +++ b/commons-spring/pom.xml @@ -7,11 +7,11 @@ ru.sokomishalov.commons commons-parent - 1.0.25 + 1.0.26 commons-spring - 1.0.25 + 1.0.26 1.3.61 @@ -31,7 +31,7 @@ ru.sokomishalov.commons commons-core - 1.0.25 + 1.0.26 diff --git a/pom.xml b/pom.xml index ef4cf8d..0cc34bb 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ ru.sokomishalov.commons commons-parent - 1.0.25 + 1.0.26 pom