Optimize log in FatWebApiApplication

This commit is contained in:
2023-10-14 20:41:12 +08:00
parent f6a7303fba
commit 1a3ae518dc

View File

@@ -24,7 +24,7 @@ fun main(args: Array<String>) {
if (File("application-config.yml").exists() || File("data/application-config.yml").exists()) { if (File("application-config.yml").exists() || File("data/application-config.yml").exists()) {
runApplication<FatWebApiApplication>(*args) runApplication<FatWebApiApplication>(*args)
} else { } else {
logger.warn("File application.yml cannot be found in the running path. The configuration file template 'application.example.yml' has been created in directory 'data'. Please change the configuration file content, rename it to 'application.yml', and then restart the server.") logger.warn("File 'application.yml' cannot be found in data path. The configuration file template 'application.example.yml' has been created in directory 'data'. Please change the configuration file content, rename it to 'application.yml', and then restart the server.")
FatWebApiApplication::class.java.getResource("/application-config-template.yml")?.readText()?.let { FatWebApiApplication::class.java.getResource("/application-config-template.yml")?.readText()?.let {
File("data/application-config.example.yml").writeText( File("data/application-config.example.yml").writeText(
it.replace( it.replace(