Skip to content

Commit

Permalink
Merge log level detection
Browse files Browse the repository at this point in the history
  • Loading branch information
tindzk committed Dec 18, 2019
1 parent 660051b commit 62082e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/main/scala/seed/build/Bloop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@ object Bsp {
if (message.contains("BSP server cancelled, closing socket..."))
// Remove "[E] " from message
debug(message.dropWhile(_ != ' ').tail)
else if (message.contains("[D]"))
debug(message.dropWhile(_ != ' ').tail, detail)
else if (message.contains("[E]"))
super.error(message.dropWhile(_ != ' ').tail, detail)
else
super.error(message, detail)
},
Expand Down
12 changes: 1 addition & 11 deletions src/main/scala/seed/process/ProcessHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,7 @@ object ProcessHelper {
List("bloop") ++ args,
modulePath,
buildPath,
new Log(log.f, log.map, log.level, log.unicode) {
override def error(message: String, detail: Boolean = false): Unit =
// This message is printed to stderr, but it is not an error, therefore
// change log level to 'debug'
if (message.contains("[D]"))
debug(message.dropWhile(_ != ' ').tail, detail)
else if (message.contains("[E]"))
super.error(message.dropWhile(_ != ' ').tail, detail)
else
super.error(message, detail)
},
log,
output => onStdOut(output),
verbose
)
Expand Down

0 comments on commit 62082e1

Please sign in to comment.