liuruiyiyang commented on a change in pull request #38: Fix sonar by Yanzhe An
URL: https://github.com/apache/incubator-iotdb/pull/38#discussion_r253022777
##########
File path: iotdb-cli/src/main/java/org/apache/iotdb/cli/tool/ExportCsv.java
##########
@@ -122,18 +126,17 @@ public static void main(String[] args) throws
IOException, SQLException {
dumpFromSqlFile(sqlFile);
}
} catch (ClassNotFoundException e) {
- System.out.println(
+ LOGGER.error(
"[ERROR] Failed to dump data because cannot find TsFile JDBC Driver,
"
+ "please check whether you have imported driver or not");
} catch (SQLException e) {
- System.out.println(
+ LOGGER.error(
String
.format("[ERROR] Encounter an error when dumping data, error is
%s", e.getMessage()));
} catch (IOException e) {
- System.out
- .println(String.format("[ERROR] Failed to operate on file, because
%s", e.getMessage()));
+ LOGGER.error(String.format("[ERROR] Failed to operate on file, because
%s", e.getMessage()));
Review comment:
you should use {} instead of %s:
```LOGGER.error(String.format("[ERROR] Failed to operate on file, because
{}", e.getMessage()));```
----------------------------------------------------------------
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