Renamed --debug-telegram to --trace-telegram and added --trace, while --debug now shows only log entries up to DEBUG level.

This commit is contained in:
Fabian Schlenz 2016-08-31 07:04:12 +02:00
parent dfd714e481
commit 8f5a9a9ad5
3 changed files with 14 additions and 6 deletions

View File

@ -222,7 +222,8 @@ public class CommandLineController {
System.out.println(" -a, --account <x> Use account <x>.");
System.out.println(" -l, --login Login to an existing telegram account.");
System.out.println(" --debug Shows some debug information.");
System.out.println(" --debug-telegram Shows lots of debug messages from the library used to access Telegram.");
System.out.println(" --trace Shows lots of debug information. Overrides --debug.");
System.out.println(" --trace-telegram Shows lots of debug messages from the library used to access Telegram.");
System.out.println(" -A, --list-accounts List all existing accounts ");
System.out.println(" --limit-messages <x> Downloads at most the most recent <x> messages.");
System.out.println(" --no-media Do not download media files.");

View File

@ -21,7 +21,8 @@ class CommandLineOptions {
public static boolean cmd_help = false;
public static boolean cmd_login = false;
public static boolean cmd_debug = false;
public static boolean cmd_debug_telegram = false;
public static boolean cmd_trace = false;
public static boolean cmd_trace_telegram = false;
public static boolean cmd_list_accounts = false;
public static boolean cmd_version = false;
public static boolean cmd_license = false;
@ -68,8 +69,11 @@ class CommandLineOptions {
case "--debug":
cmd_debug = true; break;
case "--debug-telegram":
cmd_debug_telegram = true; break;
case "--trace":
cmd_trace = true; break;
case "--trace-telegram":
cmd_trace_telegram = true; break;
case "-A": case "--list-accounts":
cmd_list_accounts = true; break;

View File

@ -50,10 +50,13 @@ public class CommandLineRunner {
rootLogger.addAppender(appender);
rootLogger.setLevel(Level.OFF);
if (CommandLineOptions.cmd_debug) {
if (CommandLineOptions.cmd_trace) {
((Logger)LoggerFactory.getLogger("de.fabianonline.telegram_backup")).setLevel(Level.TRACE);
} else if (CommandLineOptions.cmd_debug) {
((Logger)LoggerFactory.getLogger("de.fabianonline.telegram_backup")).setLevel(Level.DEBUG);
}
if (CommandLineOptions.cmd_debug_telegram) {
if (CommandLineOptions.cmd_trace_telegram) {
((Logger)LoggerFactory.getLogger("com.github.badoualy")).setLevel(Level.TRACE);
}