Skip to content

Commit

Permalink
change log color
Browse files Browse the repository at this point in the history
  • Loading branch information
dengwei03 committed Jun 18, 2020
1 parent 7fb2d10 commit bdc3d3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ package com.smartdengg.plugin.internal
class ColoredLogger {

private static final String ANSI_RESET = "\033[0m"
private static final String ANSI_RED = "\033[1;31m"
private static final String ANSI_GREEN = "\033[1;32m"
private static final String ANSI_YELLOW = "\033[1;33m"
private static final String ANSI_BLUE = "\033[1;34m"

static void logRed(String text) {
println "${ANSI_RED}${text}${ANSI_RESET}"
}
private static final String ANSI_PURPLE = "\033[1;35m"

static void logGreen(String text) {
println "${ANSI_GREEN}${text}${ANSI_RESET}"
Expand All @@ -24,6 +20,10 @@ class ColoredLogger {
println "${ANSI_BLUE}${text}${ANSI_RESET}"
}

static void logPurple(String text) {
println "${ANSI_PURPLE}${text}${ANSI_RESET}"
}

static void log(String text) {
println text
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Utils {
def startTime
doFirst { startTime = System.nanoTime() }
doLast {
ColoredLogger.logRed(
ColoredLogger.logPurple(
"====> COST: ${TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime)} ms")
}
}
Expand Down

0 comments on commit bdc3d3f

Please sign in to comment.