From 9687f9ff320c445c511bb63d1589e1bf6e891e3c Mon Sep 17 00:00:00 2001 From: Andrew Canby Date: Thu, 14 Oct 2021 13:36:49 +1100 Subject: [PATCH] Make NavigableMap deprecation message easier to follow With the deprecation of NavigableMap the logs are filled with lines suggesting not to use it, but it can be hard to track down exactly _where_ the usage was invoked. This change intends to give users a clue as to where the usage is such that they can fix it before the feature is removed --- .../src/main/groovy/org/grails/config/NavigableMap.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grails-bootstrap/src/main/groovy/org/grails/config/NavigableMap.groovy b/grails-bootstrap/src/main/groovy/org/grails/config/NavigableMap.groovy index 3ebdf43d9da..b26e10b0af0 100644 --- a/grails-bootstrap/src/main/groovy/org/grails/config/NavigableMap.groovy +++ b/grails-bootstrap/src/main/groovy/org/grails/config/NavigableMap.groovy @@ -295,7 +295,7 @@ class NavigableMap implements Map, Cloneable { Object result = get(name) if (!(result instanceof NavigableMap)) { if (LOG.isWarnEnabled()) { - LOG.warn("Accessing config through dot notation is deprecated, and it will be removed in a future release. Use 'config.getProperty(key, targetClass)' instead.") + LOG.warn("Accessing config key '{}' through dot notation is deprecated, and it will be removed in a future release. Use 'config.getProperty(key, targetClass)' instead.", name) } } return result @@ -441,7 +441,7 @@ class NavigableMap implements Map, Cloneable { this.parent = parent this.path = path if (LOG.isWarnEnabled()) { - LOG.warn("Accessing config through dot notation is deprecated, and it will be removed in a future release. Use 'config.getProperty(key, targetClass)' instead.") + LOG.warn("Accessing config key '{}' through dot notation is deprecated, and it will be removed in a future release. Use 'config.getProperty(key, targetClass)' instead.", path) } }