mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-18 09:44:47 +08:00
Migrate from slf4j to spring-jcl logger
Closes gh-819
This commit is contained in:
@@ -42,13 +42,13 @@ import io.spring.initializr.web.mapper.InitializrMetadataVersion;
|
||||
import io.spring.initializr.web.support.Agent;
|
||||
import io.spring.initializr.web.support.Agent.AgentId;
|
||||
import io.spring.initializr.web.support.CommandLineHelpGenerator;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.taskdefs.Tar;
|
||||
import org.apache.tools.ant.taskdefs.Zip;
|
||||
import org.apache.tools.ant.types.TarFileSet;
|
||||
import org.apache.tools.ant.types.ZipFileSet;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.http.CacheControl;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -76,7 +76,7 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
||||
@Controller
|
||||
public class MainController extends AbstractInitializrController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MainController.class);
|
||||
private static final Log logger = LogFactory.getLog(MainController.class);
|
||||
|
||||
/**
|
||||
* HAL JSON content type.
|
||||
@@ -337,7 +337,7 @@ public class MainController extends AbstractInitializrController {
|
||||
private ResponseEntity<byte[]> upload(File download, File dir, String fileName,
|
||||
String contentType) throws IOException {
|
||||
byte[] bytes = StreamUtils.copyToByteArray(new FileInputStream(download));
|
||||
log.info("Uploading: {} ({} bytes)", download, bytes.length);
|
||||
logger.info(String.format("Uploading: %s (%s bytes)", download, bytes.length));
|
||||
ResponseEntity<byte[]> result = createResponseEntity(bytes, contentType,
|
||||
fileName);
|
||||
this.projectGenerationInvoker.cleanTempFiles(dir);
|
||||
|
@@ -22,8 +22,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.spring.initializr.metadata.DefaultMetadataElement;
|
||||
import io.spring.initializr.metadata.InitializrMetadata;
|
||||
import io.spring.initializr.metadata.InitializrMetadataProvider;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -37,8 +37,8 @@ import org.springframework.web.client.RestTemplate;
|
||||
*/
|
||||
public class DefaultInitializrMetadataProvider implements InitializrMetadataProvider {
|
||||
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(DefaultInitializrMetadataProvider.class);
|
||||
private static final Log logger = LogFactory
|
||||
.getLog(DefaultInitializrMetadataProvider.class);
|
||||
|
||||
private final InitializrMetadata metadata;
|
||||
|
||||
@@ -75,12 +75,12 @@ public class DefaultInitializrMetadataProvider implements InitializrMetadataProv
|
||||
String url = this.metadata.getConfiguration().getEnv().getSpringBootMetadataUrl();
|
||||
if (StringUtils.hasText(url)) {
|
||||
try {
|
||||
log.info("Fetching boot metadata from {}", url);
|
||||
logger.info("Fetching boot metadata from " + url);
|
||||
return new SpringBootMetadataReader(this.objectMapper, this.restTemplate,
|
||||
url).getBootVersions();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
log.warn("Failed to fetch spring boot metadata", ex);
|
||||
logger.warn("Failed to fetch spring boot metadata", ex);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user