Package io.microsphere.spring.boot.util
Class SpringApplicationUtils
java.lang.Object
io.microsphere.spring.boot.util.SpringApplicationUtils
- All Implemented Interfaces:
io.microsphere.util.Utils
SpringApplication Utilities class- Since:
- 1.0.0
- Author:
- Mercy
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDefaultPropertiesResource(String resourceLocation) Add "defaultProperties" resource pathstatic voidaddDefaultPropertiesResources(String... resourceLocations) Add one or more "defaultProperties" resource pathsstatic StringgetLoggingLevel(org.springframework.context.ConfigurableApplicationContext context) Get logging level with upper case from the SpringPropertySourcesstatic StringgetLoggingLevel(org.springframework.core.env.PropertyResolver propertyResolver) Get logging level(Upper case) from the SpringPropertySourcesstatic org.springframework.core.io.ResourceLoadergetResourceLoader(org.springframework.boot.SpringApplication springApplication) static voidlog(org.springframework.boot.SpringApplication springApplication, String[] args, String pattern, Object... patternArgs) LogSpringApplicationstatic voidlog(org.springframework.boot.SpringApplication springApplication, String[] args, org.springframework.context.ConfigurableApplicationContext context, String pattern, Object... patternArgs) LogSpringApplication
-
Method Details
-
addDefaultPropertiesResource
Add "defaultProperties" resource path- Parameters:
resourceLocation- "defaultProperties" resource path
-
addDefaultPropertiesResources
Add one or more "defaultProperties" resource paths- Parameters:
resourceLocations- one or more "defaultProperties" resource paths
-
getDefaultPropertiesResources
- Returns:
- read-only
defaultPropertiesResources
-
getResourceLoader
public static org.springframework.core.io.ResourceLoader getResourceLoader(org.springframework.boot.SpringApplication springApplication) -
getLoggingLevel
public static String getLoggingLevel(@Nullable org.springframework.context.ConfigurableApplicationContext context) Get logging level with upper case from the SpringPropertySources- Parameters:
context-ConfigurableApplicationContextcontext- Returns:
- logging level with upper case
-
getLoggingLevel
public static String getLoggingLevel(@Nullable org.springframework.core.env.PropertyResolver propertyResolver) Get logging level(Upper case) from the SpringPropertySources- Parameters:
propertyResolver-PropertyResolver- Returns:
- logging level with upper case
-
log
public static void log(org.springframework.boot.SpringApplication springApplication, String[] args, String pattern, Object... patternArgs) LogSpringApplication- Parameters:
springApplication-SpringApplicationargs- the command line argumentspattern- the logging message patternpatternArgs- the logging message arguments
-
log
public static void log(org.springframework.boot.SpringApplication springApplication, String[] args, @Nullable org.springframework.context.ConfigurableApplicationContext context, String pattern, Object... patternArgs) LogSpringApplication- Parameters:
springApplication-SpringApplicationargs- the command line argumentscontext-ConfigurableApplicationContextpattern- the logging message patternpatternArgs- the logging message arguments
-