Skip to content

Commit

Permalink
Pass the color option through to the report factory. (#5055)
Browse files Browse the repository at this point in the history
### Problem

The color flag is currently being respected for console logging, but not for compiler/reporter logging.

### Solution

Pass `--color` through to the `ReporterConfig` using the builder API.

### Result

#4729 is unblocked, and:
```
./pants compile --no-colors testprojects/src/java/org/pantsbuild/testproject/dummies:compilation_failure_target
```
results in no color, as expected.
  • Loading branch information
Stu Hood authored Nov 4, 2017
1 parent 465c711 commit 62bd2a2
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/scala/org/pantsbuild/zinc/compiler/InputUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ object InputUtils {
.withOrder(compileOrder)
val reporter =
ReporterUtil.getDefault(
ReporterConfig.create(
"",
Int.MaxValue,
true,
settings.consoleLog.msgPredicates.toArray,
settings.consoleLog.filePredicates.toArray,
settings.consoleLog.javaLogLevel,
positionMapper
)
ReporterUtil.getDefaultReporterConfig()
.withMaximumErrors(Int.MaxValue)
.withUseColor(settings.consoleLog.color)
.withMsgFilters(settings.consoleLog.msgPredicates.toArray)
.withFileFilters(settings.consoleLog.filePredicates.toArray)
.withLogLevel(settings.consoleLog.javaLogLevel)
.withPositionMapper(positionMapper)
)
val setup =
Setup.create(
Expand Down

0 comments on commit 62bd2a2

Please sign in to comment.