Skip to content

Commit

Permalink
Merge pull request #2522 from Cousjava/revert-PAYARA-2265
Browse files Browse the repository at this point in the history
Revert "PAYARA-2265 enable ansi colours on all OSs"
  • Loading branch information
Pandrex247 committed Mar 13, 2018
1 parent d3097f4 commit 2e2697b
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 114 deletions.
69 changes: 32 additions & 37 deletions nucleus/core/logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
-->

<!-- Portions Copyright [2016-2018] [Payara Foundation and/or its affiliates] -->
<!-- Portions Copyright [2016-2017] [Payara Foundation and/or its affiliates] -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
Expand All @@ -57,47 +57,42 @@
<description>Glassfish logging classes</description>

<dependencies>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>glassfish-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.admin</groupId>
<artifactId>admin-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.cluster</groupId>
<artifactId>cluster-ssh</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>internal-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.annotations</groupId>
<artifactId>logging-annotation-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>common-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>glassfish-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.admin</groupId>
<artifactId>admin-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.cluster</groupId>
<artifactId>cluster-ssh</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>internal-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.annotations</groupId>
<artifactId>logging-annotation-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>common-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>${jsonp.version}</version>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>${jansi.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -115,7 +113,6 @@ protected boolean color() {

public void noAnsi(){
ansiColor = false;
AnsiConsole.systemUninstall();
}

protected AnsiColor getColor(Level level) {
Expand Down
7 changes: 0 additions & 7 deletions nucleus/packager/nucleus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
-->

<!-- Portions Copyright [2018] Payara Foundation and/or affiliates -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
Expand Down Expand Up @@ -254,11 +252,6 @@
<artifactId>javax.annotation-api</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>${jansi.version}</version>
</dependency>
</dependencies>
</project>

54 changes: 27 additions & 27 deletions nucleus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@
</issueManagement>

<licenses>
<license>
<name>CDDL + GPLv2 with classpath exception</name>
<url>https://raw.githubusercontent.com/payara/Payara/master/LICENSE.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
<license>
<name>CDDL + GPLv2 with classpath exception</name>
<url>https://raw.githubusercontent.com/payara/Payara/master/LICENSE.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>


Expand Down Expand Up @@ -168,15 +168,16 @@
-->

<repository>
<id>payara-patched-externals</id>
<name>Payara Patched Externals</name>
<url>https://raw.github.com/payara/Payara_PatchedProjects/master</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>payara-patched-externals</id>
<name>Payara Patched Externals</name>
<url>https://raw.github.com/payara/Payara_PatchedProjects/master</url>
<!--<url>file:///opt/PayaraDev/Payara_PatchedProjects</url>-->
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>

</repositories>
Expand All @@ -194,16 +195,16 @@
</snapshots>
</pluginRepository>
<pluginRepository>
<id>payara-patched-externals</id>
<name>Payara Patched Externals</name>
<url>https://raw.github.com/payara/Payara_PatchedProjects/master</url>
<!--<url>file:///opt/PayaraDev/Payara_PatchedProjects</url> -->
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>payara-patched-externals</id>
<name>Payara Patched Externals</name>
<url>https://raw.github.com/payara/Payara_PatchedProjects/master</url>
<!--<url>file:///opt/PayaraDev/Payara_PatchedProjects</url> -->
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

Expand Down Expand Up @@ -302,7 +303,6 @@
<glassfishbuild.version>3.2.20.payara-p1</glassfishbuild.version>
<source-annotation-processor.version>1.0</source-annotation-processor.version>
<logging-annotation-processor.version>1.7</logging-annotation-processor.version>
<jansi.version>1.17</jansi.version>
<command-security-plugin.version>1.0.8</command-security-plugin.version>
<command.security.maven.plugin.isFailureFatal>false</command.security.maven.plugin.isFailureFatal>
<copyright-plugin.version>1.39</copyright-plugin.version>
Expand Down Expand Up @@ -1087,7 +1087,7 @@ Parent is ${project.parent}</echo>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
Expand Down

0 comments on commit 2e2697b

Please sign in to comment.