Skip to content

Commit 84b2a5d

Browse files
committed
better logging
1 parent ea76ecd commit 84b2a5d

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

common/src/main/kotlin/com/lambda/core/loader/Loader.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package com.lambda.core.loader
1919

2020
import com.lambda.Lambda
2121
import com.lambda.Lambda.LOG
22-
import com.lambda.graphics.renderer.gui.font.FontRenderer
2322
import com.lambda.util.Communication.ascii
2423
import com.lambda.util.reflections.getInstances
2524
import kotlin.reflect.full.findAnnotation
@@ -33,20 +32,19 @@ object Loader {
3332
val runtime: String
3433
get() = "${(System.currentTimeMillis() - started).toDuration(DurationUnit.MILLISECONDS)}"
3534

36-
private val loadables =
37-
getInstances<Loadable> { forPackages("com.lambda") }
38-
.associateWith { it::class.findAnnotation<LoaderOrder>() }
39-
.toList()
40-
.sortedBy { (_, annotation) -> annotation?.phase ?: Phase.Post }
41-
//.sortedByDescending { (_, annotation) -> annotation?.priority }
42-
.map { it.first }
35+
private val loadables = getInstances<Loadable> { forPackages("com.lambda") }
36+
.associateWith { it::class.findAnnotation<LoaderOrder>() }
37+
.toList()
38+
.sortedWith(compareBy({ it.second?.phase ?: Phase.Post }, { it.second?.priority }))
4339

4440
fun initialize() {
4541
ascii.split("\n").forEach { LOG.info(it) }
4642
LOG.info("Initializing ${Lambda.MOD_NAME} ${Lambda.VERSION}")
4743

4844
val time = measureTimeMillis {
49-
loadables.forEach { LOG.info(it.load()) }
45+
loadables.forEach { (loadable, annotation) ->
46+
LOG.info("[${annotation?.phase ?: Phase.Post}] ${loadable.load()}")
47+
}
5048
}
5149

5250
LOG.info("${Lambda.MOD_NAME} ${Lambda.VERSION} was successfully initialized in $time ms")

common/src/main/kotlin/com/lambda/graphics/renderer/gui/font/glyph/FontGlyphs.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class FontGlyphs(
4040
init {
4141
runCatching {
4242
processGlyphs()
43-
LOG.info("Font ${font.fontName} loaded with ${charMap.size} characters")
4443
}.onFailure {
4544
LOG.error("Failed to load font glyphs: ${it.message}", it)
4645
fontTexture = MipmapTexture(BufferedImage(1024, 1024, BufferedImage.TYPE_INT_ARGB))

0 commit comments

Comments
 (0)