/** * Returns the implementation to use for the logger of the specified name, * or {@code null} if the logger would delegates to Java logging anyway. */ @Override protected DualLogger getImplementation(final String name) { return new DualLogger(name, first.getLogger(name), second.getLogger(name)); }
/** * Logs a warning for a non-critical error. The callers should have a fallback. */ private static void warning(final String method, final Exception e) { Logging.recoverableException(Logging.getLogger(Modules.REFERENCING), IdentifiedObjects.class, method, e); }
/** * Logs a method return to the {@linkplain #getDebugLevel debug level}. Compared to the * default {@link Logger}, this implementation bypass the level check in order to let * the backing logging framework do its own check. * * @param sourceClass name of class that issued the logging request. * @param sourceMethod name of the method. */ @Override public void exiting(final String sourceClass, final String sourceMethod) { logp(getDebugLevel(), sourceClass, sourceMethod, "RETURN"); }
/** * Logs a warning about an unexpected but non-fatal exception. * * @param method the source method. * @param exception the exception to log. */ private static void unexpectedException(final String method, final Exception exception) { Logging.unexpectedException(Logging.getLogger(Loggers.CRS_FACTORY), EPSGDataAccess.class, method, exception); }
/** * Invoked by the UCAR netCDF library when an error occurred. * * @param message the error message. */ @Override public void setError(final String message) { listeners.warning(message, null); }
/** * Returns the locale for error messages or warnings. * Returns {@code null} if no locale is explicitly defined. * * @return the locale, or {@code null} if not explicitly defined. */ @Override public final Locale getLocale() { return (listeners != null) ? listeners.getLocale() : null; }
/** * Removes a previously registered listener. * * @param listener the listener to remove. * @throws NoSuchElementException if the given listener is not registered in this data store. */ public void removeWarningListener(final WarningListener<? super DataStore> listener) throws NoSuchElementException { listeners.removeWarningListener(listener); }
/** * Logs a record at the specified level. The default implementation discards the exception * and delegates to <code>{@linkplain #log(Level,String) log}(level, message)</code>. * * @param level one of the message level identifiers. * @param message the message to log. * @param thrown throwable associated with log message. */ @Override public void log(final Level level, final String message, final Throwable thrown) { log(level, message); }
/** * Invoked when a recoverable exception occurred. Those exceptions must be minor enough * that they can be silently ignored in most cases. */ static void recoverableException(final Class<? extends Static> caller, final TransformException exception) { Logging.recoverableException(Logging.getLogger(Loggers.GEOMETRY), caller, "transform", exception); }
/** * Invoked when an unexpected exception occurred. Those exceptions must be non-fatal, i.e. the caller * <strong>must</strong> have a reasonable fallback (otherwise it should propagate the exception). */ private static void unexpectedException(final String methodName, final Exception exception) { Logging.unexpectedException(Logging.getLogger(Modules.REFERENCING), CRS.class, methodName, exception); } }
/** * Invoked when a non-fatal exception occurred while reading metadata. * This method sends a record to the registered listeners if any, * or logs the record otherwise. */ private void warning(final Exception e) { decoder.listeners.warning(null, e); }
/** * Removes a previously registered listener. * * @param listener the listener to remove. * @throws NoSuchElementException if the given listener is not registered in this metadata source. */ public void removeWarningListener(final WarningListener<? super MetadataSource> listener) throws NoSuchElementException { listeners.removeWarningListener(listener); }
/** * Returns the implementation to use for the logger of the specified name, * or {@code null} if the logger would delegates to Java logging anyway. */ @Override protected DualLogger getImplementation(final String name) { return new DualLogger(name, first.getLogger(name), second.getLogger(name)); }
/** * Logs a method entry to the {@linkplain #getDebugLevel debug level}. Compared to the * default {@link Logger}, this implementation bypass the level check in order to let * the backing logging framework do its own check. * * @param sourceClass name of class that issued the logging request. * @param sourceMethod name of method that is being entered. */ @Override public void entering(final String sourceClass, final String sourceMethod) { logp(getDebugLevel(), sourceClass, sourceMethod, "ENTRY"); }
/** * Logs a warning about a failure to compute the Bursa-Wolf parameters. */ private static void log(final String logger, final String method, final Exception e) { Logging.recoverableException(Logging.getLogger(logger), GeocentricAffine.class, method, e); } }
/** * Logs a warning about an exception that can be safely ignored. */ final void warning(final String method, final RuntimeException e) { Logging.recoverableException(Logging.getLogger(Loggers.MATH), Vector.class, method, e); }
/** * Logs a recoverable exception that happened (directly or indirectly) in the {@link #configuration()} method. */ private static void recoverableException(final String logger, final Exception e) { Logging.recoverableException(Logging.getLogger(logger), About.class, "configuration", e); } }
/** * Invoked for reporting exceptions that may be normal behavior. This method logs * the exception at {@link java.util.logging.Level#FINE} without stack trace. */ private static void recoverableException(final Exception warning) { Logging.recoverableException(Logging.getLogger(Modules.STORAGE), ChannelFactory.class, "prepare", warning); } }
/** * Reports the given exception as an ignorable one. We consider {@link FactoryException} or * {@link TransformException} as ignorable exceptions only if they occurred while computing * whether a point is inside the domain of validity. Failure to answer that question is * considered as an indication that the point is outside the domain of validity. */ private static void warning(final Exception e) { Logging.recoverableException(Logging.getLogger("org.apache.sis.console"), TransformCommand.class, "run", e); } }