Skip to content

Instantly share code, notes, and snippets.

@nobeans
Last active August 29, 2015 14:17
Show Gist options
  • Save nobeans/af379bba65660e2fcb3f to your computer and use it in GitHub Desktop.
Save nobeans/af379bba65660e2fcb3f to your computer and use it in GitHub Desktop.
Banner in Grails 3.0
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
def app = new GrailsApp(Application)
// インラインでロゴ文字列を指定できる
// クラスパスにbanner.txtがある場合はそちらが優先して使われる(grails-app/conf/banner.txt)。
app.setBanner { org.springframework.core.env.Environment environment, Class<?> sourceClass, PrintStream out ->
out.println ">" * 100
out.println "My Banner!"
out.println "Env: ${environment.dump()}"
out.println "Source class: ${sourceClass}"
out.println "<" * 100
}
println app.dump()
app.run()
}
}
@nobeans
Copy link
Author

nobeans commented Mar 17, 2015

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
My Banner!
Env: <org.springframework.web.context.support.StandardServletEnvironment@1080b026 logger=org.apache.commons.logging.impl.SLF4JLocationAwareLog@58ebfd03 activeProfiles=[development] defaultProfiles=[default] propertySources=[servletConfigInitParams,servletContextInitParams,systemProperties,systemEnvironment,random,applicationConfigurationProperties] propertyResolver=org.springframework.core.env.PropertySourcesPropertyResolver@5b07730f>
Source class: class grails300websample.Application
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment