Skip to content

Commit

Permalink
fix static code scan (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
Deegue authored Jul 26, 2023
1 parent 9a77b96 commit 33086a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/agent/src/main/java/org/apache/spark/raydp/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ public static void premain(String agentArgs, Instrumentation inst)

File parentDir = new File(logDir);
if (!parentDir.exists()) {
parentDir.mkdirs();
boolean flag = parentDir.mkdirs();
if (!flag) {
throw new RuntimeException("Error create log dir.");
}
}

File logFile = new File(parentDir, "/slf4j-" + pid + ".log");
try (PrintStream ps = new PrintStream(logFile)) {
try (PrintStream ps = new PrintStream(logFile, "UTF-8")) {
System.setOut(ps);
System.setErr(ps);
// slf4j binding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
.getLocation().toURI().toString();
sb.append(" from ").append(loc);
} catch (Exception e) {
e.printStackTrace();
}
} else {
sb.append("failed");
Expand Down

0 comments on commit 33086a8

Please sign in to comment.