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()
|
subsystem.initialize()
|
||||||
} catch (throwable: Throwable) {
|
} catch (throwable: Throwable) {
|
||||||
logger.crash(
|
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,
|
throwable = throwable,
|
||||||
fatal = true
|
fatal = true
|
||||||
)
|
)
|
||||||
|
@ -280,11 +280,11 @@ class Engine private constructor() {
|
||||||
logger.verb("Reloading subsystems")
|
logger.verb("Reloading subsystems")
|
||||||
for (subsystem: Subsystem in subsystems)
|
for (subsystem: Subsystem in subsystems)
|
||||||
try {
|
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()
|
subsystem.reload()
|
||||||
} catch (throwable: Throwable) {
|
} catch (throwable: Throwable) {
|
||||||
logger.crash(
|
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,
|
throwable = throwable,
|
||||||
fatal = true
|
fatal = true
|
||||||
)
|
)
|
||||||
|
@ -384,17 +384,20 @@ class Engine private constructor() {
|
||||||
|
|
||||||
// Initialize subsystems
|
// Initialize subsystems
|
||||||
logger.verb("Shutting subsystems down")
|
logger.verb("Shutting subsystems down")
|
||||||
for (subsystem: Subsystem in subsystems)
|
for (subsystem: Subsystem in subsystems) {
|
||||||
|
val subsystemVersion: String = subsystem.getVersion()
|
||||||
|
|
||||||
try {
|
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)
|
subsystem.shutdown(final = final, fatalCrash = crashed)
|
||||||
} catch (throwable: Throwable) {
|
} catch (throwable: Throwable) {
|
||||||
logger.crash(
|
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,
|
throwable = throwable,
|
||||||
fatal = true
|
fatal = true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Print shutdown message
|
// Print shutdown message
|
||||||
if (final)
|
if (final)
|
||||||
|
|
|
@ -36,8 +36,8 @@ abstract class Subsystem {
|
||||||
/**
|
/**
|
||||||
* Returns the version of this subsystem.
|
* Returns the version of this subsystem.
|
||||||
*
|
*
|
||||||
* Not called by the engine
|
* Only called by the engine between
|
||||||
* before [bootstrap].
|
* [initialize] and [shutdown].
|
||||||
*
|
*
|
||||||
* @return version
|
* @return version
|
||||||
* @since v1-alpha10
|
* @since v1-alpha10
|
||||||
|
|
Loading…
Reference in a new issue