[Lldb-commits] [PATCH] D27459: Straw-man proposal for new logging syntax

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 11 09:48:12 PST 2017


clayborg requested changes to this revision.
clayborg added a reviewer: clayborg.
clayborg added a comment.
This revision now requires changes to proceed.

Looks fine except I would rather not have file + line on by default.



================
Comment at: source/Commands/CommandObjectLog.cpp:51-52
   { LLDB_OPT_SET_1, false, "append",     'a', OptionParser::eNoArgument,       nullptr, nullptr, 0, eArgTypeNone,     "Append to the log file instead of overwriting." },
+  { LLDB_OPT_SET_1, false, "no-origin",  'O', OptionParser::eNoArgument,       nullptr, nullptr, 0, eArgTypeNone,     "Do not prepend log origin (source file) information." },
     // clang-format on
 };
----------------
This shouldn't be on by default. Maybe it should be renamed to "file-line".


================
Comment at: source/Commands/CommandObjectLog.cpp:103
 
+      log_options |= LLDB_LOG_OPTION_PREPEND_ORIGIN; // Defaults to on.
       switch (short_option) {
----------------
Don't default this to on.


================
Comment at: source/Commands/CommandObjectLog.cpp:135-136
         break;
+      case 'O':
+        log_options &= ~LLDB_LOG_OPTION_PREPEND_ORIGIN;
       default:
----------------
Reverse


https://reviews.llvm.org/D27459





More information about the lldb-commits mailing list