Skip to content

Commit d385791

Browse files
Add log message when application is ready (#665)
* Add log message when application is ready This marks the moment the application is ready more clearly now that there are 2 'Started Launcher' log messages. Additionally, this is somewhat helpful for people running LL through subprocess that want to programmatically detect when application starts to accept connections. * Change "Application" to "Lavalink" Co-authored-by: Freya Arbjerg <[email protected]>
1 parent d8527b0 commit d385791

File tree

1 file changed

+6
-0
lines changed
  • LavalinkServer/src/main/java/lavalink/server

1 file changed

+6
-0
lines changed

LavalinkServer/src/main/java/lavalink/server/Launcher.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication
3434
import org.springframework.boot.builder.SpringApplicationBuilder
3535
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent
3636
import org.springframework.boot.context.event.ApplicationFailedEvent
37+
import org.springframework.boot.context.event.ApplicationReadyEvent
3738
import org.springframework.context.ApplicationListener
3839
import org.springframework.context.ConfigurableApplicationContext
3940
import org.springframework.context.annotation.ComponentScan
@@ -150,6 +151,11 @@ object Launcher {
150151
log.info(getVersionInfo())
151152
}
152153
},
154+
ApplicationListener { event: Any ->
155+
if (event is ApplicationReadyEvent) {
156+
log.info("Lavalink is ready to accept connections.")
157+
}
158+
},
153159
ApplicationListener { event: Any ->
154160
if (event is ApplicationFailedEvent) {
155161
log.error("Application failed", event.exception)

0 commit comments

Comments
 (0)