Skip to content

Commit

Permalink
Merge pull request #32 from vahidhashemian/skip_stacktrace_for_ec2_de…
Browse files Browse the repository at this point in the history
…tection

Skip logging stacktrace for EC2 detection
  • Loading branch information
vahidhashemian authored Mar 5, 2024
2 parents e6b4a15 + 1cc0d95 commit 7c90b23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions psc/src/main/java/com/pinterest/psc/common/PscUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected static boolean doesEc2MetadataExist() {
Process process = processBuilder.start();
return process.waitFor() == 0;
} catch (Exception e) {
logger.info("Could not detect if host is EC2 from ec2metadata.", e);
logger.info("Could not detect if host is EC2 from ec2metadata.", e.getMessage());
return false;
}
}
Expand All @@ -51,7 +51,7 @@ protected static boolean isSysVendorAws() {
try {
return getFileContent("/sys/devices/virtual/dmi/id/sys_vendor").trim().equals("Amazon EC2");
} catch (Exception e) {
logger.info("Could not detect if host is EC2 from sys vendor.", e);
logger.info("Could not detect if host is EC2 from sys vendor.", e.getMessage());
return false;
}
}
Expand All @@ -60,7 +60,7 @@ protected static boolean isAwsOsDetected() {
try {
return System.getProperty("os.version").contains("aws");
} catch (Exception e) {
logger.info("Could not detect if host is EC2 from os version.", e);
logger.info("Could not detect if host is EC2 from os version.", e.getMessage());
return false;
}
}
Expand Down

0 comments on commit 7c90b23

Please sign in to comment.