/** * Returns the warning to log, or {@code null} if none. The caller is responsible for setting the logger name, * source class name and source method name. * * @param fine {@code true} for including warnings at fine level, or {@code false} for only the warning level. * @return the warning to log, or {@code null} if none. */ public LogRecord warning(final boolean fine) { if (arguments != null) { if (resourceKey != 0) { return Resources.forLocale(null).getLogRecord(Level.WARNING, resourceKey, arguments); } else if (fine) { return new LogRecord(Level.FINE, (String) arguments[0]); } } return null; } }
/** * Returns the warning to log, or {@code null} if none. The caller is responsible for setting the logger name, * source class name and source method name. * * @param fine {@code true} for including warnings at fine level, or {@code false} for only the warning level. * @return the warning to log, or {@code null} if none. */ public LogRecord warning(final boolean fine) { if (arguments != null) { if (resourceKey != 0) { return Resources.forLocale(null).getLogRecord(Level.WARNING, resourceKey, arguments); } else if (fine) { return new LogRecord(Level.FINE, (String) arguments[0]); } } return null; } }
/** * Logs a message about a grid which is about to be loaded. * * @param caller the provider to logs as the source class. * the source method will be set to {@code "createMathTransform"}. * @param file the grid file, as a {@link String} or a {@link Path}. */ static void log(final Class<?> caller, final Object file) { final LogRecord record = Resources.forLocale(null).getLogRecord(Level.FINE, Resources.Keys.LoadingDatumShiftFile_1, file); record.setLoggerName(Loggers.COORDINATE_OPERATION); Logging.log(caller, "createMathTransform", record); }
/** * Logs a message about a grid which is about to be loaded. * * @param caller the provider to logs as the source class. * the source method will be set to {@code "createMathTransform"}. * @param file the grid file, as a {@link String} or a {@link Path}. */ static void log(final Class<?> caller, final Object file) { final LogRecord record = Resources.forLocale(null).getLogRecord(Level.FINE, Resources.Keys.LoadingDatumShiftFile_1, file); record.setLoggerName(Loggers.COORDINATE_OPERATION); Logging.log(caller, "createMathTransform", record); }
/** * Logs a warning about a factory not found for the requested version, in which case * {@code AuthorityFactoryIdentifier} fallback on a default version. */ void logFallback() { log(Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.FallbackDefaultFactoryVersion_2, authority, version)); }
/** * Logs a warning about a factory not found for the requested version, in which case * {@code AuthorityFactoryIdentifier} fallback on a default version. */ void logFallback() { log(Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.FallbackDefaultFactoryVersion_2, authority, version)); }
/** * Logs a message reporting a conflict between the factory identified by this {@code AuthorityFactoryIdentifier} * and another factory, if this instance has not already logged a warning. This method assumes that it is invoked * by the {@code MultiAuthoritiesFactory.getAuthorityFactory(…)} method. * * @param used the factory which will be used. */ void logConflict(final AuthorityFactory used) { log(Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.IgnoredServiceProvider_3, TYPES[type], getAuthorityAndVersion(), Classes.getClass(used))); }
/** * Logs a message reporting a conflict between the factory identified by this {@code AuthorityFactoryIdentifier} * and another factory, if this instance has not already logged a warning. This method assumes that it is invoked * by the {@code MultiAuthoritiesFactory.getAuthorityFactory(…)} method. * * @param used the factory which will be used. */ void logConflict(final AuthorityFactory used) { log(Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.IgnoredServiceProvider_3, TYPES[type], getAuthorityAndVersion(), Classes.getClass(used))); }
LogRecord record = Resources.forLocale(locale).getLogRecord(Level.WARNING, Resources.Keys.DeprecatedCode_3, Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code, replacedBy, reason); record.setLoggerName(Loggers.CRS_FACTORY);
LogRecord record = Resources.forLocale(locale).getLogRecord(Level.WARNING, Resources.Keys.DeprecatedCode_3, Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code, replacedBy, reason); record.setLoggerName(Loggers.CRS_FACTORY);
/** * Creates operations from source and target coordinate reference system codes. * If the authority for the two given CRS is handled by the same factory, then * this method delegates to that factory. Otherwise this method returns an empty set. * * @throws FactoryException if the object creation failed. */ @Override public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes( final String sourceCRS, final String targetCRS) throws FactoryException { final Deferred deferred = new Deferred(); final CoordinateOperationAuthorityFactory factory = create(deferred, sourceCRS); final String source = deferred.code; if (create(deferred, targetCRS) == factory) { return factory.createFromCoordinateReferenceSystemCodes(source, deferred.code); } /* * No coordinate operation because of mismatched factories. This is not illegal (the result is an empty set) * but it is worth to notify the user because this case has some chances to be an user error. */ final LogRecord record = Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.MismatchedOperationFactories_2, sourceCRS, targetCRS); record.setLoggerName(Loggers.CRS_FACTORY); Logging.log(MultiAuthoritiesFactory.class, "createFromCoordinateReferenceSystemCodes", record); return super.createFromCoordinateReferenceSystemCodes(sourceCRS, targetCRS); }
/** * Creates operations from source and target coordinate reference system codes. * If the authority for the two given CRS is handled by the same factory, then * this method delegates to that factory. Otherwise this method returns an empty set. * * @throws FactoryException if the object creation failed. */ @Override public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes( final String sourceCRS, final String targetCRS) throws FactoryException { final Deferred deferred = new Deferred(); final CoordinateOperationAuthorityFactory factory = create(deferred, sourceCRS); final String source = deferred.code; if (create(deferred, targetCRS) == factory) { return factory.createFromCoordinateReferenceSystemCodes(source, deferred.code); } /* * No coordinate operation because of mismatched factories. This is not illegal (the result is an empty set) * but it is worth to notify the user because this case has some chances to be an user error. */ final LogRecord record = Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.MismatchedOperationFactories_2, sourceCRS, targetCRS); record.setLoggerName(Loggers.CRS_FACTORY); Logging.log(MultiAuthoritiesFactory.class, "createFromCoordinateReferenceSystemCodes", record); return super.createFromCoordinateReferenceSystemCodes(sourceCRS, targetCRS); }
final LogRecord record = resources().getLogRecord(Level.WARNING, Resources.Keys.AmbiguousEllipsoid_1, Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code); record.setLoggerName(Loggers.CRS_FACTORY);
final LogRecord record = resources().getLogRecord(Level.WARNING, Resources.Keys.AmbiguousEllipsoid_1, Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code); record.setLoggerName(Loggers.CRS_FACTORY);
log(Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.MissingParameterValues_1, IdentifiedObjects.getIdentifierOrName(operation)), null);
log(Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.MissingParameterValues_1, IdentifiedObjects.getIdentifierOrName(operation)), null);
final LogRecord record = Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.MismatchedEllipsoidAxisLength_3, ellipsoid.getName().getCode(), mismatchedParam.getDescriptor().getName().getCode(), mismatchedValue);
final LogRecord record = Resources.forLocale(null).getLogRecord(Level.WARNING, Resources.Keys.MismatchedEllipsoidAxisLength_3, ellipsoid.getName().getCode(), mismatchedParam.getDescriptor().getName().getCode(), mismatchedValue);