Étape 5 #84

Merged
louis_royer merged 19 commits from etape5 into master 2020-03-30 15:23:11 +02:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit 15e1bd2e75 - Show all commits

View File

@ -34,17 +34,21 @@ public class Logger {
* @param text Text to log
*/
public void write(String text, LogLevel logLevel) {
String colorize = "\u001B[0";
String msg = "[" + new Timestamp(System.currentTimeMillis()) + "] " + text + "\n";
String level = null;
switch (logLevel) {
case Error:
level = "[Error]";
colorize = "\u001B[31m"; // RED
break;
case Info:
level = "[Info]";
colorize = "\u001B[32m"; // GREEN
break;
case Warning:
level = "[Warning]";
colorize = "\u001B[33m"; // YELLOW
break;
case Action:
level = "[Action]";
@ -64,7 +68,7 @@ public class Logger {
case Warning:
case Debug:
default:
System.err.println(text);
System.err.println(colorize + text + "\u001B[0m");
break;
case Action:
break;

View File

@ -6,7 +6,7 @@ package tools;
* @author JS Auge
* @version 1.0
*/
public class PortRange {
public abstract class PortRange {
protected int portMax;
protected int portMin;
@ -34,7 +34,7 @@ public class PortRange {
}
/** To String
* @return String representation
* @return String representation
*/
public String toString() {
return "default " + type + "port: " + defaultPort + "(range: " + portMin + " -> " + portMax + ")";