thread warning + better logging
This commit is contained in:
@@ -8,11 +8,15 @@ public class Log {
|
|||||||
private static PrintStream lastStream = System.out;
|
private static PrintStream lastStream = System.out;
|
||||||
|
|
||||||
public static void e(String who, String msg) {
|
public static void e(String who, String msg) {
|
||||||
printNonStatic(String.valueOf(who) + " : " + msg, System.err);
|
printNonStatic("[ERROR]" + who + " : " + msg, System.err);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void w(String who, String msg) {
|
||||||
|
printNonStatic("[WARN]" + who + " : " + msg, System.out);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void i(String who, String msg) {
|
public static void i(String who, String msg) {
|
||||||
if(Main.verbose) printNonStatic(String.valueOf(who) + " : " + msg, System.out);
|
if(Main.verbose) printNonStatic("[INFO]" + who + " : " + msg, System.out);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void printNonStatic(String line, PrintStream stream) {
|
private static void printNonStatic(String line, PrintStream stream) {
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ public class Main {
|
|||||||
String cmd = it.next();
|
String cmd = it.next();
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case "-t":
|
case "-t":
|
||||||
|
Log.w("main", "Warning using -t option can lead to corruption during download if you have a lot of cores or a slow internet");
|
||||||
|
|
||||||
if (threadNb != null) {
|
if (threadNb != null) {
|
||||||
Log.e("main", "error conflicting arguments --thread and -t");
|
Log.e("main", "error conflicting arguments --thread and -t");
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user