[FIX] Фикс отображения HTML логов

This commit is contained in:
Gravit 2019-04-13 08:13:46 +07:00
parent bd44a55f6b
commit 3f7cbbb004
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
5 changed files with 16 additions and 9 deletions

View file

@ -19,7 +19,7 @@ public DownloadAssetCommand(LaunchServer server) {
@Override @Override
public String getArgsDescription() { public String getArgsDescription() {
return "<version> <dir>"; return "[version] [dir]";
} }
@Override @Override

View file

@ -24,7 +24,7 @@ public DownloadClientCommand(LaunchServer server) {
@Override @Override
public String getArgsDescription() { public String getArgsDescription() {
return "<version> <dir>"; return "[version] [dir]";
} }
@Override @Override

View file

@ -81,7 +81,7 @@ public IndexAssetCommand(LaunchServer server) {
@Override @Override
public String getArgsDescription() { public String getArgsDescription() {
return "<dir> <index> <output-dir>"; return "[dir] [index] [output-dir]";
} }
@Override @Override

View file

@ -24,7 +24,7 @@ public UnindexAssetCommand(LaunchServer server) {
@Override @Override
public String getArgsDescription() { public String getArgsDescription() {
return "<dir> <index> <output-dir>"; return "[dir] [index] [output-dir]";
} }
@Override @Override

View file

@ -403,16 +403,23 @@ public static String htmlFormatLog(Level level, String dateTime, String message,
String levelColor; String levelColor;
switch (level) { switch (level) {
case WARNING: case WARNING:
levelColor = "yellow"; levelColor = "gravitlauncher-log-warning";
break; break;
case ERROR: case ERROR:
levelColor = "red"; levelColor = "gravitlauncher-log-error";
break; break;
default: // INFO, DEBUG, Unknown case INFO:
levelColor = "white"; levelColor = "gravitlauncher-log-info";
break;
case DEBUG:
levelColor = "gravitlauncher-log-debug";
break;
default:
levelColor = "gravitlauncher-log-unknown";
break; break;
} }
return String.format("%s <b><font color=\"%s\">[%s] %s</font></b>", dateTime, levelColor, level.toString(), sub ? ' ' + message : message); if(sub) levelColor += " gravitlauncher-log-sub";
return String.format("%s <span class=\"gravitlauncher-log %s\">[%s] %s</span>", dateTime, levelColor, level.toString(), sub ? ' ' + message : message);
} }
private static String ansiFormatVersion(String product) { private static String ansiFormatVersion(String product) {