jamesfredley commented on code in PR #15694:
URL: https://github.com/apache/grails-core/pull/15694#discussion_r3499818327
##########
grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/logging/template/logback.rocker.raw:
##########
@@ -17,14 +17,14 @@ specific language governing permissions and limitations
under the License.
*@
-@args (String projectName, String packageName, boolean jansi)
+@args (String projectName, String packageName)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
- <withJansi>@jansi</withJansi>
+ <withJansi>false</withJansi>
Review Comment:
Good call - added an explanatory comment above
`<withJansi>false</withJansi>` in the generated `logback-spring.xml`. It notes
that Jansi is intentionally disabled because it replaces `System.out` globally,
which is incompatible with reloading tools (Spring Boot DevTools) and breaks
console logging after a restart, and that colors come from Spring Boot's `%clr`
converter via `CONSOLE_LOG_PATTERN` so Jansi isn't needed. Done in a392fc918c.
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -846,6 +846,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
project.tasks.withType(BootRun).configureEach { BootRun it ->
it.dependsOn(findMainClassTask)
it.mainClass.convention(GrailsGradlePlugin.getMainClassProvider(project))
+ it.systemProperty('spring.output.ansi.console-available',
'true')
Review Comment:
It doesn't need the `OS != Windows` guard - setting
`spring.output.ansi.console-available=true` is not a force-on. Spring Boot's
`AnsiOutput` in DETECT mode (the default) still gates Windows out internally:
`detectIfAnsiCapable()` ends with `return
!(OPERATING_SYSTEM_NAME.contains(\win\))` (verified in Spring Boot 3.5.x
`AnsiOutput`). So on legacy Windows consoles no raw ANSI escapes are emitted
regardless of this property; the only thing it does is tell AnsiOutput a
console is available under `bootRun` (where `System.console()` is null),
enabling colors on macOS/Linux and modern terminals. Setting it unconditionally
is therefore correct, and an OS check here would just duplicate Spring Boot's
own logic. I've added a code comment explaining this above the line in
a392fc918c.
--
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]