refactor: banner info. (#634)

pull/635/head
Ryan Wang 2020-03-11 20:09:59 +08:00 committed by GitHub
parent 6b967ad256
commit 22b24835aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -4,6 +4,8 @@ import lombok.extern.slf4j.Slf4j;
import org.flywaydb.core.Flyway;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ansi.AnsiColor;
import org.springframework.boot.ansi.AnsiOutput;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
@ -64,12 +66,12 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
private void printStartInfo() {
String blogUrl = optionService.getBlogBaseUrl();
log.info("Halo started at {}", blogUrl);
log.info("Halo admin started at {}/{}", blogUrl, haloProperties.getAdminPath());
log.info(AnsiOutput.toString(AnsiColor.BRIGHT_BLUE, "Halo started at ", blogUrl));
log.info(AnsiOutput.toString(AnsiColor.BRIGHT_BLUE, "Halo admin started at ", blogUrl, "/", haloProperties.getAdminPath()));
if (!haloProperties.isDocDisabled()) {
log.debug("Halo api doc was enabled at {}/swagger-ui.html", blogUrl);
log.debug(AnsiOutput.toString(AnsiColor.BRIGHT_BLUE, "Halo api doc was enabled at ", blogUrl, "/swagger-ui.html"));
}
log.info("Halo has started successfully!");
log.info(AnsiOutput.toString(AnsiColor.BRIGHT_YELLOW, "Halo has started successfully!"));
}
/**

4
src/main/resources/banner.txt Executable file → Normal file
View File

@ -4,5 +4,5 @@ ${AnsiColor.BLUE}
/ /_/ / __ `/ / __ \
/ __ / /_/ / / /_/ /
/_/ /_/\__,_/_/\____/
${AnsiColor.BRIGHT_YELLOW}
::: Spring-Boot ${spring-boot.version} ::: Halo (version:${application.formatted-version})
${AnsiColor.BRIGHT_YELLOW}
Version: ${application.version}