Skip to content

Commit

Permalink
Add log message when application is ready (#665)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Jackenmen and freyacodes authored Jun 10, 2022
1 parent d8527b0 commit d385791
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions LavalinkServer/src/main/java/lavalink/server/Launcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent
import org.springframework.boot.context.event.ApplicationFailedEvent
import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.ApplicationListener
import org.springframework.context.ConfigurableApplicationContext
import org.springframework.context.annotation.ComponentScan
Expand Down Expand Up @@ -150,6 +151,11 @@ object Launcher {
log.info(getVersionInfo())
}
},
ApplicationListener { event: Any ->
if (event is ApplicationReadyEvent) {
log.info("Lavalink is ready to accept connections.")
}
},
ApplicationListener { event: Any ->
if (event is ApplicationFailedEvent) {
log.error("Application failed", event.exception)
Expand Down

0 comments on commit d385791

Please sign in to comment.