Move LoggerThreadingHandler, support start & stop

This commit is contained in:
JeremyStar™ 2024-12-16 02:32:50 +01:00
parent 31c015dc65
commit 479c965c1a
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
4 changed files with 10 additions and 2 deletions

View file

@ -27,7 +27,7 @@ import de.staropensource.engine.base.implementation.logging.KotlinShutdownHandle
import de.staropensource.engine.base.implementation.logging.crashcategory.InfoCrashCategory
import de.staropensource.engine.base.implementation.logging.formatbuilder.SOSLSv2FormatBuilder
import de.staropensource.engine.base.logging.Logger
import de.staropensource.engine.base.logging.LoggerThreadingHandler
import de.staropensource.engine.base.implementable.logging.LoggerThreadingHandler
import de.staropensource.engine.base.type.logging.ChannelSettings
import de.staropensource.engine.base.type.logging.Feature
import de.staropensource.engine.base.type.logging.Level
@ -166,6 +166,11 @@ class EngineConfiguration private constructor() {
*/
@JvmStatic
var logThreadingHandler: LoggerThreadingHandler? = null
set(value) {
logThreadingHandler?.stop()
logThreadingHandler = value
logThreadingHandler?.start()
}
/**
* Controls the [FormatBuilder] to use.

View file

@ -18,8 +18,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.staropensource.engine.base.logging
package de.staropensource.engine.base.implementable.logging
import de.staropensource.engine.base.logging.Processor
import de.staropensource.engine.base.type.logging.Call
/**

View file

@ -21,6 +21,7 @@
package de.staropensource.engine.base.logging
import de.staropensource.engine.base.EngineConfiguration
import de.staropensource.engine.base.implementable.logging.LoggerThreadingHandler
import de.staropensource.engine.base.type.logging.Call
import de.staropensource.engine.base.type.logging.Level
import kotlinx.datetime.Clock

View file

@ -24,6 +24,7 @@ import de.staropensource.engine.base.EngineConfiguration
import de.staropensource.engine.base.implementable.logging.Adapter
import de.staropensource.engine.base.implementable.logging.FormatBuilder
import de.staropensource.engine.base.implementable.logging.Formatter
import de.staropensource.engine.base.implementable.logging.LoggerThreadingHandler
import de.staropensource.engine.base.type.logging.Call
import de.staropensource.engine.base.type.logging.ChannelSettings
import de.staropensource.engine.base.type.logging.Feature