From 8beb823a9b40bade79897c049a4fc80c8f6e819b Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sun, 30 Oct 2011 18:39:18 -0400 Subject: [PATCH] cleanup, add regex for escape sequences to be used later --- util/log/ConsoleLogger.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/log/ConsoleLogger.scala b/util/log/ConsoleLogger.scala index 34c8a9575..a453b3b8a 100644 --- a/util/log/ConsoleLogger.scala +++ b/util/log/ConsoleLogger.scala @@ -46,6 +46,10 @@ object ConsoleLogger def apply(out: PrintWriter): ConsoleLogger = apply(printWriterOut(out)) def apply(out: ConsoleOut, ansiCodesSupported: Boolean = formatEnabled, useColor: Boolean = formatEnabled): ConsoleLogger = new ConsoleLogger(out, ansiCodesSupported, useColor) + + private[this] val EscapeSequence = (27.toChar + "[^@-~]*[@-~]").r + def stripEscapeSequences(s: String): String = + EscapeSequence.pattern.matcher(s).replaceAll("") } /** A logger that logs to the console. On supported systems, the level labels are