liuruiyiyang commented on a change in pull request #38: Fix sonar by Yanzhe An
URL: https://github.com/apache/incubator-iotdb/pull/38#discussion_r253026178
##########
File path: iotdb-cli/src/main/java/org/apache/iotdb/cli/tool/ImportCsv.java
##########
@@ -230,26 +238,32 @@ private static void loadDataFromCSV(File file, int
index) {
statement.clearBatch();
count = 0;
tmp.clear();
- System.out.println(String.format("[INFO] Load data from %s
successfully,"
+ LOGGER.info(String.format("[INFO] Load data from %s successfully,"
+ " it takes %dms", file.getName(),
- (System.currentTimeMillis() - startTime)));
+ System.currentTimeMillis() - startTime));
} catch (SQLException e) {
bw.write(e.getMessage());
bw.newLine();
errorFlag = false;
}
} catch (FileNotFoundException e) {
- System.out.println("[ERROR] Cannot find " + file.getName());
+ LOGGER.error("[ERROR] Cannot find " + file.getName());
} catch (IOException e) {
- System.out.println("[ERROR] CSV file read exception!" + e.getMessage());
+ LOGGER.error("[ERROR] CSV file read exception!" + e.getMessage());
} catch (SQLException e) {
- System.out.println("[ERROR] Database connection exception!" +
e.getMessage());
+ LOGGER.error("[ERROR] Database connection exception!" + e.getMessage());
Review comment:
format specifier should be used instead of string concatenation
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services