소스 검색

删除多余的e.printStackTrace();

zhujinghui 4 년 전
부모
커밋
a723f555c0
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/main/java/com/example/demo/util/FileUtils.java

+ 3 - 3
src/main/java/com/example/demo/util/FileUtils.java

@@ -380,7 +380,7 @@ public class FileUtils {
             if (inputStream != null) {
                 inputStream.close();
             }
-            System.out.println("info:" + url + " download success");
+            log.info("info:" + url + " download success");
         } catch(FileNotFoundException e){
             return false;
         } catch (IOException e) {
@@ -390,14 +390,14 @@ public class FileUtils {
                 try {
                     fos.close();
                 } catch (IOException e) {
-                    e.printStackTrace();
+                    log.error("下载文件异常", e);
                 }
             }
             if (inputStream != null) {
                 try {
                     inputStream.close();
                 } catch (IOException e) {
-                    e.printStackTrace();
+                    log.error("下载文件异常", e);
                 }
             }
         }