Skip to content

Commit 688db39

Browse files
committed
[logs] Write exception to log instead of printing stack trace
1 parent 6173cef commit 688db39

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/org/apache/ibatis/io/ExternalResources.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,12 +24,17 @@
2424
import java.nio.channels.FileChannel;
2525
import java.util.Properties;
2626

27+
import org.apache.ibatis.logging.Log;
28+
import org.apache.ibatis.logging.LogFactory;
29+
2730
/**
2831
* @author Clinton Begin
2932
*/
3033
@Deprecated
3134
public class ExternalResources {
3235

36+
private static final Log log = LogFactory.getLog(ExternalResources.class);
37+
3338
private ExternalResources() {
3439
// do nothing
3540
}
@@ -72,7 +77,7 @@ public static String getConfiguredTemplate(String templatePath, String templateP
7277
} catch (FileNotFoundException e) {
7378
throw e;
7479
} catch (Exception e) {
75-
e.printStackTrace();
80+
log.error("", e);
7681
}
7782

7883
return templateName;

0 commit comments

Comments
 (0)