24
24
import org .apache .commons .logging .Log ;
25
25
import org .apache .commons .logging .LogFactory ;
26
26
27
+ import org .springframework .aot .AotDetector ;
27
28
import org .springframework .boot .system .ApplicationHome ;
28
29
import org .springframework .boot .system .ApplicationPid ;
29
30
import org .springframework .context .ApplicationContext ;
@@ -64,7 +65,8 @@ void logStarted(Log applicationLog, Duration timeTakenToStartup) {
64
65
65
66
private CharSequence getStartingMessage () {
66
67
StringBuilder message = new StringBuilder ();
67
- message .append ("Starting " );
68
+ message .append ("Starting" );
69
+ appendAotMode (message );
68
70
appendApplicationName (message );
69
71
appendVersion (message , this .sourceClass );
70
72
appendJavaVersion (message );
@@ -85,7 +87,7 @@ private CharSequence getRunningMessage() {
85
87
86
88
private CharSequence getStartedMessage (Duration timeTakenToStartup ) {
87
89
StringBuilder message = new StringBuilder ();
88
- message .append ("Started " );
90
+ message .append ("Started" );
89
91
appendApplicationName (message );
90
92
message .append (" in " );
91
93
message .append (timeTakenToStartup .toMillis () / 1000.0 );
@@ -100,9 +102,13 @@ private CharSequence getStartedMessage(Duration timeTakenToStartup) {
100
102
return message ;
101
103
}
102
104
105
+ private void appendAotMode (StringBuilder message ) {
106
+ append (message , "" , () -> AotDetector .useGeneratedArtifacts () ? "AOT-processed" : null );
107
+ }
108
+
103
109
private void appendApplicationName (StringBuilder message ) {
104
- String name = ( this . sourceClass != null ) ? ClassUtils . getShortName ( this . sourceClass ) : "application" ;
105
- message . append ( name );
110
+ append ( message , "" ,
111
+ () -> ( this . sourceClass != null ) ? ClassUtils . getShortName ( this . sourceClass ) : "application" );
106
112
}
107
113
108
114
private void appendVersion (StringBuilder message , Class <?> source ) {
0 commit comments