/** * Test whether a throwable, if {@link #notify(int, Throwable) notified} at the given * level, will actually be displayed in any way (even to a log file etc.). * If not, there is no point in constructing it. * <p>This method is distinct from {@link #isLoggable} because an error manager * implementation may choose to notify stack traces at a level where it would * not log messages. See issue #24056 for justification. * <p>The default implementation just calls {@link #isLoggable}. Subclasses * should override to be more precise - <strong>treat this method as abstract</strong>. * @param severity a notification severity * @return true if a throwable notified at this severity will be used; false if it will be ignored * @since 3.18 */ public boolean isNotifiable(int severity) { return isLoggable(severity); }
/** Calls all delegates. */ public boolean isLoggable(int severity) { if (severity == UNKNOWN) { throw new IllegalArgumentException("ErrorManager.isLoggable(UNKNOWN) is not permitted"); // NOI18N } if (delegates.isEmpty()) { return logger().isLoggable(convertSeverity(severity, false, null)); } for (ErrorManager em : delegates) { if (em.isLoggable(severity)) { return true; } } return false; }
/** * Test whether a throwable, if {@link #notify(int, Throwable) notified} at the given * level, will actually be displayed in any way (even to a log file etc.). * If not, there is no point in constructing it. * <p>This method is distinct from {@link #isLoggable} because an error manager * implementation may choose to notify stack traces at a level where it would * not log messages. See issue #24056 for justification. * <p>The default implementation just calls {@link #isLoggable}. Subclasses * should override to be more precise - <strong>treat this method as abstract</strong>. * @param severity a notification severity * @return true if a throwable notified at this severity will be used; false if it will be ignored * @since 3.18 */ public boolean isNotifiable(int severity) { return isLoggable(severity); }
/** Calls all delegates. */ public boolean isLoggable(int severity) { if (severity == UNKNOWN) { throw new IllegalArgumentException("ErrorManager.isLoggable(UNKNOWN) is not permitted"); // NOI18N } if (delegates.isEmpty()) { return logger().isLoggable(convertSeverity(severity, false, null)); } for (ErrorManager em : delegates) { if (em.isLoggable(severity)) { return true; } } return false; }
private boolean isLoggable() { return err.isLoggable(ErrorManager.INFORMATIONAL); } private boolean isLoggable(int sev) {
private boolean isLoggable(int sev) { return err.isLoggable(sev); } private void log(int sev, String msg) {
private boolean isLoggable() { return err.isLoggable(ErrorManager.INFORMATIONAL); } private static void logErrorInfo(String msg) {
public static boolean isLoggable() { return err.isLoggable(err.INFORMATIONAL) ; } public static boolean isLoggable(int sev) {
public static boolean isLoggable(int sev) { return err.isLoggable(sev) ; } public static void log(int sev, String x) {
public static void dumpStack(Class clazz) { // log(Class,String) only has an effect if INFORMATIONAL logging enabled on that prefix if(ErrorManager.getDefault().getInstance(clazz.getName()) .isLoggable(ErrorManager.INFORMATIONAL)) { StringWriter sw = new StringWriter(); new Throwable().printStackTrace(new PrintWriter(sw)); log(clazz, sw.getBuffer().toString()); } }
static boolean isLoggable(Class clazz) { if (System.getProperty(clazz.getName()) == null) { return false; } boolean result = ErrorManager.getDefault().getInstance( clazz.getName()).isLoggable(ErrorManager.INFORMATIONAL); return result; }
static boolean isLoggable(Class clazz) { if (System.getProperty(clazz.getName()) == null) { return false; } boolean result = ErrorManager.getDefault().getInstance( clazz.getName()).isLoggable(ErrorManager.INFORMATIONAL); return result; }
public static void dumpStack(Class clazz) { // log(Class,String) only has an effect if INFORMATIONAL logging enabled on that prefix if(ErrorManager.getDefault().getInstance(clazz.getName()) .isLoggable(ErrorManager.INFORMATIONAL)) { StringWriter sw = new StringWriter(); new Throwable().printStackTrace(new PrintWriter(sw)); log(clazz, sw.getBuffer().toString()); } }
/** Calls all delegates. */ public boolean isLoggable(int severity) { if (severity == UNKNOWN) { throw new IllegalArgumentException("ErrorManager.isLoggable(UNKNOWN) is not permitted"); // NOI18N } if (delegates.isEmpty()) { return logger().isLoggable(convertSeverity(severity, false, null)); } for (ErrorManager em : delegates) { if (em.isLoggable(severity)) { return true; } } return false; }
private static final void initErr () { if (! errInited) { errInited = true; ErrorManager master = ErrorManager.getDefault(); ErrorManager tmp = master.getInstance("org.openide.actions.MoveUpAction"); // NOI18N if (tmp.isLoggable (ErrorManager.INFORMATIONAL)) { err = tmp; } } }
private static final void initErr () { if (! errInited) { errInited = true; ErrorManager master = ErrorManager.getDefault(); ErrorManager tmp = master.getInstance("org.openide.actions.MoveUpAction"); // NOI18N if (tmp.isLoggable (ErrorManager.INFORMATIONAL)) { err = tmp; } } }
/** Fired when a new file has been created. This action can only be * listened in folders containing the created file up to the root of * file system. * * @param fe the event describing context where action has taken place */ public void fileDataCreated (FileEvent fe) { final boolean LOG = err.isLoggable(ErrorManager.INFORMATIONAL); if (LOG) err.log ("fileDataCreated: " + fe); refresh(); }
/** Fired when a new file has been created. This action can only be * listened in folders containing the created file up to the root of * file system. * * @param fe the event describing context where action has taken place */ public void fileFolderCreated (FileEvent fe) { final boolean LOG = err.isLoggable(ErrorManager.INFORMATIONAL); if (LOG) err.log ("fileFolderCreated: " + fe); refresh(); }
/** Fired when a new file has been renamed. * * @param fe the event describing context where action has taken place */ public void fileRenamed (FileRenameEvent fe) { final boolean LOG = err.isLoggable(ErrorManager.INFORMATIONAL); if (LOG) err.log ("fileRenamed: " + fe); refresh(); // Typically order may change as a result (#13820): changeComparator(); }
/** * @param f folder to display content of * @param filter filter of objects */ public FolderChildren (DataFolder f, DataFilter filter) { this.folder = f; this.filter = filter; this.listener = org.openide.util.WeakListeners.propertyChange (this, folder); err = ErrorManager.getDefault().getInstance("org.openide.loaders.FolderChildren." + f.getPrimaryFile().getPath().replace('/','.')); // NOI18N if (!err.isLoggable(ErrorManager.INFORMATIONAL)) { err = null; } }