summaryrefslogtreecommitdiffstats
path: root/logcat/logcat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logcat/logcat.cpp')
-rw-r--r--logcat/logcat.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index 858e56c..b557011 100644
--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -219,8 +219,8 @@ static void show_help(const char *cmd)
" -f <filename> Log to file. Default to stdout\n"
" -r [<kbytes>] Rotate log every kbytes. (16 if unspecified). Requires -f\n"
" -n <count> Sets max number of rotated logs to <count>, default 4\n"
- " -v <format> Sets the log print format, where <format> is one of:\n\n"
- " brief process tag thread raw time threadtime long\n\n"
+ " -v <format> Sets the log print format, where <format> is:\n\n"
+ " brief color long process raw tag thread threadtime time\n\n"
" -c clear (flush) the entire log and exit\n"
" -d dump the log and then exit (don't block)\n"
" -t <count> print only the most recent <count> lines (implies -d)\n"
@@ -259,7 +259,7 @@ static void show_help(const char *cmd)
"\nIf not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS.\n"
"If no filterspec is found, filter defaults to '*:I'\n"
"\nIf not specified with -v, format is set from ANDROID_PRINTF_LOG\n"
- "or defaults to \"brief\"\n\n");
+ "or defaults to \"threadtime\"\n\n");
@@ -543,7 +543,9 @@ int main(int argc, char **argv)
exit(-1);
}
- hasSetLogFormat = 1;
+ if (strcmp("color", optarg)) { // exception for modifiers
+ hasSetLogFormat = 1;
+ }
break;
case 'Q':
@@ -653,11 +655,12 @@ int main(int argc, char **argv)
if (logFormat != NULL) {
err = setLogFormat(logFormat);
-
if (err < 0) {
fprintf(stderr, "invalid format in ANDROID_PRINTF_LOG '%s'\n",
logFormat);
}
+ } else {
+ setLogFormat("threadtime");
}
}