Skip to content

Commit

Permalink
feat: add create dump log
Browse files Browse the repository at this point in the history
  • Loading branch information
YongwuHe committed Jan 3, 2024
1 parent dedc8c0 commit 0be2ff3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,14 @@ private void createDumpDirectory() {

try {
File bytecodeDumpPath = new File(agentFile.getParent(), BYTECODE_DUMP_DIR);
if (!bytecodeDumpPath.exists()) {
bytecodeDumpPath.mkdir();
} else {
boolean exists = bytecodeDumpPath.exists();
boolean mkdir = false;
if (exists) {
FileUtils.cleanDirectory(bytecodeDumpPath);
} else {
mkdir = bytecodeDumpPath.mkdir();
}
LOGGER.info("[arex] bytecode dump path exists: {}, mkdir: {}, path: {}", exists, mkdir, bytecodeDumpPath.getPath());
System.setProperty(TypeWriter.DUMP_PROPERTY, bytecodeDumpPath.getPath());
} catch (Exception e) {
LOGGER.info("[arex] Failed to create directory to instrumented bytecode: {}", e.getMessage());
Expand Down

0 comments on commit 0be2ff3

Please sign in to comment.