src/jdk.jpackager/share/classes/jdk/jpackager/internal/Log.java
branchJDK-8200758-branch
changeset 57020 a828547f7e50
parent 57017 1b08af362a30
equal deleted inserted replaced
57019:585939d9f952 57020:a828547f7e50
    74             } else {
    74             } else {
    75                 System.out.println(msg);
    75                 System.out.println(msg);
    76             }
    76             }
    77         }
    77         }
    78 
    78 
    79         public void infof(String format, Object... args) {
       
    80             if (out != null) {
       
    81                 out.printf(format, args);
       
    82             } else {
       
    83                 System.out.printf(format, args);
       
    84             }
       
    85         }
       
    86 
       
    87         public void error(String msg) {
    79         public void error(String msg) {
    88             if (err != null) {
    80             if (err != null) {
    89                 err.println(msg);
    81                 err.println(msg);
    90             } else {
    82             } else {
    91                 System.err.println(msg);
    83                 System.err.println(msg);
   142         if (delegate != null) {
   134         if (delegate != null) {
   143            delegate.info(msg);
   135            delegate.info(msg);
   144         }
   136         }
   145     }
   137     }
   146 
   138 
   147     public static void infof(String format, Object... args) {
       
   148         if (delegate != null) {
       
   149            delegate.infof(format, args);
       
   150         }
       
   151     }
       
   152 
       
   153     public static void error(String msg) {
   139     public static void error(String msg) {
   154         if (delegate != null) {
   140         if (delegate != null) {
   155             delegate.error(msg);
   141             delegate.error(msg);
   156         }
   142         }
   157     }
   143     }
   186         if (delegate != null) {
   172         if (delegate != null) {
   187            delegate.debug(msg);
   173            delegate.debug(msg);
   188         }
   174         }
   189     }
   175     }
   190 
   176 
   191     public static void debug(RuntimeException re) {
       
   192         debug((Throwable) re);
       
   193     }
       
   194 
       
   195     public static void debug(Throwable t) {
   177     public static void debug(Throwable t) {
   196         try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
   178         try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
   197             try (PrintStream ps = new PrintStream(baos)) {
   179             try (PrintStream ps = new PrintStream(baos)) {
   198                 t.printStackTrace(ps);
   180                 t.printStackTrace(ps);
   199             }
   181             }