code cleanup

deleted deadcode
This commit is contained in:
lukas-heiligenbrunner
2020-04-03 13:26:44 +02:00
parent b3fcd26964
commit f4a00620a3
17 changed files with 107 additions and 248 deletions

View File

@ -51,7 +51,7 @@ public class Info {
starttime = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss").format(new Date());
Properties prop = new Properties();
try {
URL url = Info.class.getResource("/version.properties");
URL url = Info.class.getResource("/version.prop");
prop.load(url.openStream());
version = (String) prop.get("version");
@ -75,10 +75,10 @@ public class Info {
long allocatedMemory = runtime.totalMemory();
long freeMemory = runtime.freeMemory();
sb.append("free memory: " + format.format(freeMemory / 1024) + "\n");
sb.append("allocated memory: " + format.format(allocatedMemory / 1024) + "\n");
sb.append("max memory: " + format.format(maxMemory / 1024) + "\n");
sb.append("total free memory: " + format.format((freeMemory + (maxMemory - allocatedMemory)) / 1024) + "\n");
sb.append("free memory: ").append(format.format(freeMemory / 1024)).append("\n");
sb.append("allocated memory: ").append(format.format(allocatedMemory / 1024)).append("\n");
sb.append("max memory: ").append(format.format(maxMemory / 1024)).append("\n");
sb.append("total free memory: ").append(format.format((freeMemory + (maxMemory - allocatedMemory)) / 1024)).append("\n");
System.out.println(sb.toString());
}

View File

@ -5,22 +5,22 @@ import java.util.*
class Log {
companion object Log{
val CRITICAL_ERROR = 6
val ERROR = 5
val WARNING = 4
val INFO = 3
val MESSAGE = 2
val DEBUG = 1
const val CRITICAL_ERROR = 6
const val ERROR = 5
const val WARNING = 4
const val INFO = 3
const val MESSAGE = 2
const val DEBUG = 1
private val ANSI_RESET = "\u001B[0m"
private val ANSI_BLACK = "\u001B[30m"
private val ANSI_RED = "\u001B[31m"
private val ANSI_GREEN = "\u001B[32m"
private val ANSI_YELLOW = "\u001B[33m"
private val ANSI_BLUE = "\u001B[34m"
private val ANSI_PURPLE = "\u001B[35m"
private val ANSI_CYAN = "\u001B[36m"
private val ANSI_WHITE = "\u001B[37m"
private const val ANSI_RESET = "\u001B[0m"
private const val ANSI_BLACK = "\u001B[30m"
private const val ANSI_RED = "\u001B[31m"
private const val ANSI_GREEN = "\u001B[32m"
private const val ANSI_YELLOW = "\u001B[33m"
private const val ANSI_BLUE = "\u001B[34m"
private const val ANSI_PURPLE = "\u001B[35m"
private const val ANSI_CYAN = "\u001B[36m"
private const val ANSI_WHITE = "\u001B[37m"
private var Loglevel = 0
@ -126,14 +126,14 @@ class Log {
fun setLevel(level: Int) {
Loglevel = level
}
private val colors = ArrayList(Arrays.asList("", "DEBUG", "MESSAGE", "INFO", "WARNING", "ERROR", "CRITICAL_ERROR"))
private val colors = ArrayList(listOf("", "DEBUG", "MESSAGE", "INFO", "WARNING", "ERROR", "CRITICAL_ERROR"))
private fun calcDate(millisecs: Long): String? {
val date_format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
val resultdate = Date(millisecs)
return date_format.format(resultdate)
private fun calcDate(milliSecs: Long): String? {
val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
val resultDate = Date(milliSecs)
return dateFormat.format(resultDate)
}
}
}