Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip logging stacktrace for EC2 detection #37

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading