void (String displayName, String text, @NotNull Throwable ex) { Throwable cause = ex.getCause() != null ? ex.getCause() : ex; String message = displayName == null ? text : displayName + ": " + text; Application app = ApplicationManager.getApplication(); if (app != null && app.isUnitTestMode()) { LOG.error(message, cause); } else { LOG.warn(message, cause); } }