From 2e2697bfb3a4f08e538bbab898f5a3435a1c2f1a Mon Sep 17 00:00:00 2001 From: Andrew Pielage Date: Tue, 13 Mar 2018 08:32:23 +0000 Subject: [PATCH] Merge pull request #2522 from Cousjava/revert-PAYARA-2265 Revert "PAYARA-2265 enable ansi colours on all OSs" --- nucleus/core/logging/pom.xml | 69 +++++++++--------- .../enterprise/server/logging/AnsiColor.java | 71 +++++++++---------- .../server/logging/AnsiColorFormatter.java | 5 +- nucleus/packager/nucleus/pom.xml | 7 -- nucleus/pom.xml | 54 +++++++------- 5 files changed, 92 insertions(+), 114 deletions(-) diff --git a/nucleus/core/logging/pom.xml b/nucleus/core/logging/pom.xml index 19e1dfa0a4a..9295e5863a4 100755 --- a/nucleus/core/logging/pom.xml +++ b/nucleus/core/logging/pom.xml @@ -41,7 +41,7 @@ --> - + @@ -57,47 +57,42 @@ Glassfish logging classes - - org.glassfish.main.common - glassfish-api - ${project.version} - - - org.glassfish.main.admin - admin-util - ${project.version} - - - org.glassfish.main.cluster - cluster-ssh - ${project.version} - provided - - - org.glassfish.main.common - internal-api - ${project.version} - - - org.glassfish.annotations - logging-annotation-processor - true - - - org.glassfish.main.common - common-util - ${project.version} - + + org.glassfish.main.common + glassfish-api + ${project.version} + + + org.glassfish.main.admin + admin-util + ${project.version} + + + org.glassfish.main.cluster + cluster-ssh + ${project.version} + provided + + + org.glassfish.main.common + internal-api + ${project.version} + + + org.glassfish.annotations + logging-annotation-processor + true + + + org.glassfish.main.common + common-util + ${project.version} + javax.json javax.json-api ${jsonp.version} - - org.fusesource.jansi - jansi - ${jansi.version} - diff --git a/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/AnsiColor.java b/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/AnsiColor.java index cdcc3b0649a..d16635119cc 100644 --- a/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/AnsiColor.java +++ b/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/AnsiColor.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2017-2018 Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) 2017 Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -39,54 +39,47 @@ */ package com.sun.enterprise.server.logging; -import org.fusesource.jansi.Ansi; - /** - * @since 4.1.1.173 + * * @author steve */ public enum AnsiColor { - BLACK(Ansi.ansi().fgBlack()), - RED(Ansi.ansi().fgRed()), - YELLOW(Ansi.ansi().fgYellow()), - BLUE(Ansi.ansi().fgBlue()), - PURPLE(Ansi.ansi().fgMagenta()), - CYAN(Ansi.ansi().fgCyan()), - WHITE(Ansi.ansi().fg(Ansi.Color.WHITE)), - GREEN(Ansi.ansi().fgGreen()), - INTENSE_BLACK(Ansi.ansi().fgBrightBlack()), - INTENSE_RED(Ansi.ansi().fgBrightRed()), - INTENSE_YELLOW(Ansi.ansi().fgBrightYellow()), - INTENSE_BLUE(Ansi.ansi().fgBrightBlue()), - INTENSE_PURPLE(Ansi.ansi().fgBrightMagenta()), - INTENSE_CYAN(Ansi.ansi().fgBrightCyan()), - INTENSE_WHITE(Ansi.ansi().fgBright(Ansi.Color.WHITE)), - INTENSE_GREEN(Ansi.ansi().fgBrightGreen()), - BOLD_INTENSE_BLACK(Ansi.ansi().bold().fgBrightBlack()), - BOLD_INTENSE_RED(Ansi.ansi().bold().fgBrightRed()), - BOLD_INTENSE_YELLOW(Ansi.ansi().bold().fgBrightYellow()), - BOLD_INTENSE_BLUE(Ansi.ansi().bold().fgBrightBlue()), - BOLD_INTENSE_PURPLE(Ansi.ansi().bold().fgBrightMagenta()), - BOLD_INTENSE_CYAN(Ansi.ansi().bold().fgBrightCyan()), - BOLD_INTENSE_WHITE(Ansi.ansi().bold().fgBright(Ansi.Color.WHITE)), - BOLD_INTENSE_GREEN(Ansi.ansi().bold().fgBrightGreen()), - RESET(Ansi.ansi().reset()), - NOTHING(Ansi.ansi()); + BLACK("\u001B[0;30m"), + RED("\u001B[0;31m"), + YELLOW("\u001B[0;33m"), + BLUE("\u001B[0;34m"), + PURPLE("\u001B[0;35m"), + CYAN("\u001B[0;36m"), + WHITE("\u001B[0;37m"), + GREEN("\u001B[0;32m"), + INTENSE_BLACK("\u001B[0;90m"), + INTENSE_RED("\u001B[0;91m"), + INTENSE_YELLOW("\u001B[0;93m"), + INTENSE_BLUE("\u001B[0;94m"), + INTENSE_PURPLE("\u001B[0;95m"), + INTENSE_CYAN("\u001B[0;96m"), + INTENSE_WHITE("\u001B[0;97m"), + INTENSE_GREEN("\u001B[0;92m"), + BOLD_INTENSE_BLACK("\u001B[1;90m"), + BOLD_INTENSE_RED("\u001B[1;91m"), + BOLD_INTENSE_YELLOW("\u001B[1;93m"), + BOLD_INTENSE_BLUE("\u001B[1;94m"), + BOLD_INTENSE_PURPLE("\u001B[1;95m"), + BOLD_INTENSE_CYAN("\u001B[1;96m"), + BOLD_INTENSE_WHITE("\u001B[1;97m"), + BOLD_INTENSE_GREEN("\u001B[1;92m"), + RESET("\u001b[0m"), + NOTHING(""); - AnsiColor(Ansi colour) { - colourAnsi = colour; + AnsiColor(String color) { + colorString = color; } - @Override public String toString() { - return colourAnsi.toString(); - } - - public Ansi getANsi(){ - return colourAnsi; + return colorString; } - private final Ansi colourAnsi; + private final String colorString; } diff --git a/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/AnsiColorFormatter.java b/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/AnsiColorFormatter.java index 3168bb4e0a5..6107792fd34 100644 --- a/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/AnsiColorFormatter.java +++ b/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/AnsiColorFormatter.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2017-2018 Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) 2017 Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -43,7 +43,6 @@ import java.util.logging.Formatter; import java.util.logging.Level; import java.util.logging.LogManager; -import org.fusesource.jansi.AnsiConsole; /** * @since 4.1.1.173 @@ -60,7 +59,6 @@ public AnsiColorFormatter() { String color = manager.getProperty(this.getClass().getCanonicalName() + ".ansiColor"); if ("true".equals(color)) { ansiColor = true; - AnsiConsole.systemInstall(); } colors = new HashMap<>(); colors.put(Level.INFO, AnsiColor.BOLD_INTENSE_GREEN); @@ -115,7 +113,6 @@ protected boolean color() { public void noAnsi(){ ansiColor = false; - AnsiConsole.systemUninstall(); } protected AnsiColor getColor(Level level) { diff --git a/nucleus/packager/nucleus/pom.xml b/nucleus/packager/nucleus/pom.xml index 970a6aa7c62..ba7a339f967 100644 --- a/nucleus/packager/nucleus/pom.xml +++ b/nucleus/packager/nucleus/pom.xml @@ -41,8 +41,6 @@ --> - - 4.0.0 @@ -254,11 +252,6 @@ javax.annotation-api true - - org.fusesource.jansi - jansi - ${jansi.version} - diff --git a/nucleus/pom.xml b/nucleus/pom.xml index 2931b336740..4825949bc84 100644 --- a/nucleus/pom.xml +++ b/nucleus/pom.xml @@ -71,12 +71,12 @@ - - CDDL + GPLv2 with classpath exception - https://raw.githubusercontent.com/payara/Payara/master/LICENSE.txt - repo - A business-friendly OSS license - + + CDDL + GPLv2 with classpath exception + https://raw.githubusercontent.com/payara/Payara/master/LICENSE.txt + repo + A business-friendly OSS license + @@ -168,15 +168,16 @@ --> - payara-patched-externals - Payara Patched Externals - https://raw.github.com/payara/Payara_PatchedProjects/master - - true - - - false - + payara-patched-externals + Payara Patched Externals + https://raw.github.com/payara/Payara_PatchedProjects/master + + + true + + + false + @@ -194,16 +195,16 @@ - payara-patched-externals - Payara Patched Externals - https://raw.github.com/payara/Payara_PatchedProjects/master - - - true - - - true - + payara-patched-externals + Payara Patched Externals + https://raw.github.com/payara/Payara_PatchedProjects/master + + + true + + + true + @@ -302,7 +303,6 @@ 3.2.20.payara-p1 1.0 1.7 - 1.17 1.0.8 false 1.39 @@ -1087,7 +1087,7 @@ Parent is ${project.parent} jackson-core ${jackson.version} - + com.fasterxml.jackson.core jackson-annotations ${jackson.version}