You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2023/12/14 00:21:59 UTC
(pinot) branch master updated: Fix for #12133 - add context and proper logging framework to OsCheck output (#12135)
This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new f3b94f60e4 Fix for #12133 - add context and proper logging framework to OsCheck output (#12135)
f3b94f60e4 is described below
commit f3b94f60e442e93a02d201cb4e83b13cee231347
Author: Tim Veil <32...@users.noreply.github.com>
AuthorDate: Wed Dec 13 19:21:53 2023 -0500
Fix for #12133 - add context and proper logging framework to OsCheck output (#12135)
---
.../main/java/org/apache/pinot/core/util/OsCheck.java | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/util/OsCheck.java b/pinot-core/src/main/java/org/apache/pinot/core/util/OsCheck.java
index a8ba40da5f..c3a52d1a12 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/util/OsCheck.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/util/OsCheck.java
@@ -19,12 +19,14 @@
package org.apache.pinot.core.util;
import java.util.Locale;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public final class OsCheck {
// cached result of OS detection
- protected static final OSType _detectedOS;
+ private static final OSType DETECTED_OS;
private OsCheck() {
}
@@ -36,7 +38,7 @@ public final class OsCheck {
* @return - the operating system detected
*/
public static OSType getOperatingSystemType() {
- return _detectedOS;
+ return DETECTED_OS;
}
/**
@@ -46,17 +48,19 @@ public final class OsCheck {
Windows, MacOS, Linux, Other
}
+ private static final Logger LOGGER = LoggerFactory.getLogger(OsCheck.class);
+
static {
String os = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
- System.out.println(os);
+ LOGGER.info("System property \"os.name\" is: {}", os);
if ((os.contains("mac")) || (os.contains("darwin"))) {
- _detectedOS = OSType.MacOS;
+ DETECTED_OS = OSType.MacOS;
} else if (os.contains("win")) {
- _detectedOS = OSType.Windows;
+ DETECTED_OS = OSType.Windows;
} else if (os.contains("linux")) {
- _detectedOS = OSType.Linux;
+ DETECTED_OS = OSType.Linux;
} else {
- _detectedOS = OSType.Other;
+ DETECTED_OS = OSType.Other;
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org