Add subsystem version to log messages
This commit is contained in:
parent
91128541f9
commit
048ae6b074
2 changed files with 11 additions and 8 deletions
|
@ -226,7 +226,7 @@ class Engine private constructor() {
|
|||
subsystem.initialize()
|
||||
} catch (throwable: Throwable) {
|
||||
logger.crash(
|
||||
"Failed to initialize subsystem '${subsystem.getName()}' [${subsystem::class.qualifiedName ?: "<anonymous>"}]",
|
||||
"Failed to initialize subsystem '${subsystem.getName()}'@'${subsystem.getVersion()}' [${subsystem::class.qualifiedName ?: "<anonymous>"}]",
|
||||
throwable = throwable,
|
||||
fatal = true
|
||||
)
|
||||
|
@ -280,11 +280,11 @@ class Engine private constructor() {
|
|||
logger.verb("Reloading subsystems")
|
||||
for (subsystem: Subsystem in subsystems)
|
||||
try {
|
||||
logger.diag("Reloading subsystem '${subsystem.getName()}' [${subsystem::class.qualifiedName ?: "<anonymous>"}]")
|
||||
logger.diag("Reloading subsystem '${subsystem.getName()}'@'${subsystem.getVersion()}' [${subsystem::class.qualifiedName ?: "<anonymous>"}]")
|
||||
subsystem.reload()
|
||||
} catch (throwable: Throwable) {
|
||||
logger.crash(
|
||||
"Failed to reload subsystem '${subsystem.getName()}' [${subsystem::class.qualifiedName ?: "<anonymous>"}]",
|
||||
"Failed to reload subsystem '${subsystem.getName()}'@'${subsystem.getVersion()}' [${subsystem::class.qualifiedName ?: "<anonymous>"}]",
|
||||
throwable = throwable,
|
||||
fatal = true
|
||||
)
|
||||
|
@ -384,17 +384,20 @@ class Engine private constructor() {
|
|||
|
||||
// Initialize subsystems
|
||||
logger.verb("Shutting subsystems down")
|
||||
for (subsystem: Subsystem in subsystems)
|
||||
for (subsystem: Subsystem in subsystems) {
|
||||
val subsystemVersion: String = subsystem.getVersion()
|
||||
|
||||
try {
|
||||
logger.diag("Shutting subsystem '${subsystem.getName()}' [${subsystem::class.qualifiedName ?: "<anonymous>"}] down")
|
||||
logger.diag("Shutting subsystem '${subsystem.getName()}'@'${subsystemVersion}' [${subsystem::class.qualifiedName ?: "<anonymous>"}] down")
|
||||
subsystem.shutdown(final = final, fatalCrash = crashed)
|
||||
} catch (throwable: Throwable) {
|
||||
logger.crash(
|
||||
"Failed to shutdown subsystem '${subsystem.getName()}' [${subsystem::class.qualifiedName ?: "<anonymous>"}]",
|
||||
"Failed to shutdown subsystem '${subsystem.getName()}'@'${subsystemVersion}' [${subsystem::class.qualifiedName ?: "<anonymous>"}]",
|
||||
throwable = throwable,
|
||||
fatal = true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Print shutdown message
|
||||
if (final)
|
||||
|
|
|
@ -36,8 +36,8 @@ abstract class Subsystem {
|
|||
/**
|
||||
* Returns the version of this subsystem.
|
||||
*
|
||||
* Not called by the engine
|
||||
* before [bootstrap].
|
||||
* Only called by the engine between
|
||||
* [initialize] and [shutdown].
|
||||
*
|
||||
* @return version
|
||||
* @since v1-alpha10
|
||||
|
|
Loading…
Reference in a new issue