paulk-asert opened a new pull request, #2901: URL: https://github.com/apache/groovy/pull/2901
…ler locations via LogBuilder.withLocation Logging frameworks locate a statement's caller by walking the stack, and every frame Groovy's runtime inserts (metaclass dispatch, the reflective cold tier, GraalVM's method-handle interpreter in a native image) makes that answer wrong. Log4j2 offers no skip list but does let the caller supply the location. With staticLocation = true the transform rewrites log.info(msg) to log.atInfo().withLocation(loc).log(msg), where loc is a StackTraceElement for the statement held in a synthetic static field, so the location is correct however the call is dispatched and Log4j2 skips its stack walk. A leading Marker or trailing Throwable variable is routed through withMarker/withThrowable at run time, since the builder does not extract a message's throwable itself. Opt-in: the call shape changes and LogBuilder needs Log4j 2.13+, which the transform checks at compile time. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
