优化日志输出

This commit is contained in:
zhaojun1998
2020-01-20 21:35:41 +08:00
parent f6163c7e19
commit 9715cf922a
9 changed files with 19 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ public class AliyunServiceImpl extends AbstractS3FileService implements FileServ
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常, 已跳过");
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常, 已跳过");
}
}

View File

@@ -81,7 +81,7 @@ public abstract class AbstractFileService extends FileCacheService implements Fi
try {
fileList("/");
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常", e);
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常", e);
flag = false;
}
return flag;
@@ -95,6 +95,14 @@ public abstract class AbstractFileService extends FileCacheService implements Fi
return !isInitialized;
}
/**
* 获取是否初始化成功
* @return 初始化成功与否
*/
public boolean getIsInitialized() {
return isInitialized;
}
/**
* 获取存储策略类型
* @return 存储策略类型枚举

View File

@@ -56,7 +56,7 @@ public class FtpServiceImpl extends AbstractFileService implements FileService {
}
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常, 已跳过");
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常, 已跳过");
}
}

View File

@@ -48,7 +48,7 @@ public class HuaweiServiceImpl extends AbstractS3FileService implements FileServ
isInitialized = testConnection();
}
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常, 已跳过");
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常, 已跳过");
}
}

View File

@@ -54,7 +54,7 @@ public class LocalServiceImpl extends AbstractFileService implements FileService
isInitialized = testConnection();
}
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常, 已跳过");
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常, 已跳过");
}
}

View File

@@ -46,7 +46,7 @@ public class MinIOServiceImpl extends AbstractS3FileService implements FileServi
isInitialized = testConnection();
}
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常, 已跳过");
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常, 已跳过");
}
}

View File

@@ -48,7 +48,7 @@ public class QiniuServiceImpl extends AbstractS3FileService implements FileServi
isInitialized = testConnection();
}
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常, 已跳过");
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常, 已跳过");
}
}

View File

@@ -47,7 +47,7 @@ public class TencentServiceImpl extends AbstractS3FileService implements FileSer
isInitialized = testConnection();
}
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常, 已跳过");
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常, 已跳过");
}
}

View File

@@ -12,8 +12,7 @@ import im.zhaojun.common.service.AbstractFileService;
import im.zhaojun.common.service.FileService;
import im.zhaojun.common.service.StorageConfigService;
import im.zhaojun.common.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -27,10 +26,9 @@ import java.util.Objects;
* @author zhaojun
*/
@Service
@Slf4j
public class UpYunServiceImpl extends AbstractFileService implements FileService {
private static final Logger log = LoggerFactory.getLogger(UpYunServiceImpl.class);
private static final String END_MARK = "g2gCZAAEbmV4dGQAA2VvZg";
@Resource
@@ -62,7 +60,7 @@ public class UpYunServiceImpl extends AbstractFileService implements FileService
isInitialized = testConnection();
}
} catch (Exception e) {
log.debug(getStorageTypeEnum().getDescription() + "初始化异常, 已跳过");
log.debug(getStorageTypeEnum().getDescription() + " 初始化异常, 已跳过");
}
}