mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 11:54:59 -04:00
Log: start observing profile after loading
Improves preboot performance a lot
This commit is contained in:
parent
16df6decf7
commit
a60a2b9be1
@ -13,16 +13,22 @@
|
|||||||
|
|
||||||
package de.bixilon.minosoft.config.profile.profiles.other
|
package de.bixilon.minosoft.config.profile.profiles.other
|
||||||
|
|
||||||
import de.bixilon.kutil.json.MutableJsonObject
|
import com.fasterxml.jackson.databind.node.ObjectNode
|
||||||
import de.bixilon.minosoft.config.profile.storage.StorageProfileManager
|
import de.bixilon.minosoft.config.profile.storage.StorageProfileManager
|
||||||
|
import de.bixilon.minosoft.util.logging.Log
|
||||||
|
|
||||||
object OtherProfileManager : StorageProfileManager<OtherProfile>() {
|
object OtherProfileManager : StorageProfileManager<OtherProfile>() {
|
||||||
override val type get() = OtherProfile
|
override val type get() = OtherProfile
|
||||||
override val latestVersion get() = 3
|
override val latestVersion get() = 3
|
||||||
|
|
||||||
override fun migrate(version: Int, data: MutableJsonObject) = when (version) {
|
override fun migrate(version: Int, data: ObjectNode) = when (version) {
|
||||||
1 -> OtherProfileMigration.migrate1(data)
|
1 -> OtherProfileMigration.migrate1(data)
|
||||||
2 -> OtherProfileMigration.migrate2(data)
|
2 -> OtherProfileMigration.migrate2(data)
|
||||||
else -> Unit
|
else -> Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun load() {
|
||||||
|
super.load()
|
||||||
|
Log.observeProfile()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ abstract class StorageProfileManager<P : Profile> : Iterable<P>, Identified {
|
|||||||
return load(storage, content)
|
return load(storage, content)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun load() {
|
open fun load() {
|
||||||
loadAll()
|
loadAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,6 @@ object Log {
|
|||||||
QUEUE.take().print()
|
QUEUE.take().print()
|
||||||
}
|
}
|
||||||
}, "Log").start()
|
}, "Log").start()
|
||||||
OtherProfileManager::selected.observe(this) { this.levels = it.log.levels }
|
|
||||||
ShutdownManager.addHook { ASYNC_LOGGING = false; catchAll { await() } }
|
ShutdownManager.addHook { ASYNC_LOGGING = false; catchAll { await() } }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,4 +198,8 @@ object Log {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun init() = Unit
|
fun init() = Unit
|
||||||
|
|
||||||
|
fun observeProfile() {
|
||||||
|
OtherProfileManager::selected.observe(this, true) { this.levels = it.log.levels }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user