This is an automated email from the ASF dual-hosted git repository.

mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ccbfa0  [NO ISSUE] Add API to override log level on halt
0ccbfa0 is described below

commit 0ccbfa019d8abbd5b754b579f3d8ca902569edcb
Author: Michael Blow <mb...@apache.org>
AuthorDate: Tue Mar 12 17:17:21 2019 -0400

    [NO ISSUE] Add API to override log level on halt
    
    Change-Id: Ia5574d5f51c23f6972c5f086938f355a0b55d007
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/3268
    Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Murtadha Hubail <mhub...@apache.org>
    Tested-by: Michael Blow <mb...@apache.org>
---
 .../src/main/java/org/apache/hyracks/util/ExitUtil.java        | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
 
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
index e2ae73a..52c8f55 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
@@ -24,6 +24,7 @@ import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.lang3.mutable.MutableLong;
+import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
@@ -90,8 +91,13 @@ public class ExitUtil {
         exit(status);
     }
 
-    public static synchronized void halt(int status) {
-        LOGGER.fatal("JVM halting with status {}; thread dump at halt: {}", 
status, ThreadDumpUtil.takeDumpString());
+    public static void halt(int status) {
+        halt(status, Level.FATAL);
+    }
+
+    public static synchronized void halt(int status, Level logLevel) {
+        LOGGER.log(logLevel, "JVM halting with status {}; thread dump at halt: 
{}", status,
+                ThreadDumpUtil.takeDumpString());
         // try to give time for the log to be emitted...
         LogManager.shutdown();
         Runtime.getRuntime().halt(status);

Reply via email to