@Override public void log (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[info] " + tag + ": " + message)); exception.printStackTrace(); }
@Override public void error (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[error] " + tag + ": " + message)); exception.printStackTrace(); }
@Override public void debug (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[debug] " + tag + ": " + message)); exception.printStackTrace(); } }
@Override public void debug (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[debug] " + tag + ": " + message)); exception.printStackTrace(); } }
@Override public void error (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[error] " + tag + ": " + message)); exception.printStackTrace(); }
@Override public void log (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[info] " + tag + ": " + message)); exception.printStackTrace(); }
@Override public void error (String tag, String message) { Foundation.log("%@", new NSString("[error] " + tag + ": " + message)); }
@Override public void log (String tag, String message) { Foundation.log("%@", new NSString("[info] " + tag + ": " + message)); }
@Override public void error (String tag, String message) { Foundation.log("%@", new NSString("[error] " + tag + ": " + message)); }
@Override public void debug (String tag, String message) { Foundation.log("%@", new NSString("[debug] " + tag + ": " + message)); }
@Override public void debug (String tag, String message) { Foundation.log("%@", new NSString("[debug] " + tag + ": " + message)); }
@Override public void log (String tag, String message) { Foundation.log("%@", new NSString("[info] " + tag + ": " + message)); }
@Override public void flush() { if (st.length() > 0) { Foundation.log("%@", new NSString(st.toString())); st.setLength(0); } }
/** * Preloads classes added during compilation, if any. */ private static void preloadClasses() throws UnsupportedEncodingException { byte[] data = VM.getRuntimeData(UIApplication.class.getName() + ".preloadClasses"); if (data != null) { String[] customClasses = new String(data, "UTF8").split(","); for (String customClass : customClasses) { try { // Register class. @SuppressWarnings("unchecked") Class<? extends ObjCClass> cls = (Class<? extends ObjCClass>) Class.forName(customClass); ObjCClass.registerCustomClass(cls); } catch (Throwable t) { Foundation.log("Failed to preload class " + customClass + ": " + t.getMessage()); t.printStackTrace(); } } } }
@Override public void uncaughtException (Thread thread, Throwable ex) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); pw.flush(); Foundation.log(sw.toString()); NSException exception = new NSException(ex.getClass().getName(), sw.toString(), new NSDictionary<>()); if (NSThread.getCurrentThread().isMainThread()) { exception.raise(); } else { long handler = getUncaughtExceptionHandler(); callUncaughtExceptionHandler(handler, exception); // We should never get to this line! } } });
@Override public void flush() { if (st.length() > 0) { Foundation.log("%@", new NSString(st.toString())); st.setLength(0); } }
@Override public void log (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[info] " + tag + ": " + message)); exception.printStackTrace(); }
@Override public void error (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[error] " + tag + ": " + message)); exception.printStackTrace(); }
@Override public void debug (String tag, String message, Throwable exception) { Foundation.log("%@", new NSString("[debug] " + tag + ": " + message)); exception.printStackTrace(); } }