[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
public String getArgsDescription() {
return "<version> <dir>";
return "[version] [dir]";
}
@Override

View file

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

View file

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

View file

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

View file

@ -403,16 +403,23 @@ public static String htmlFormatLog(Level level, String dateTime, String message,
String levelColor;
switch (level) {
case WARNING:
levelColor = "yellow";
levelColor = "gravitlauncher-log-warning";
break;
case ERROR:
levelColor = "red";
levelColor = "gravitlauncher-log-error";
break;
default: // INFO, DEBUG, Unknown
levelColor = "white";
case INFO:
levelColor = "gravitlauncher-log-info";
break;
case DEBUG:
levelColor = "gravitlauncher-log-debug";
break;
default:
levelColor = "gravitlauncher-log-unknown";
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) {