Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbf37366 authored by Arman Uguray's avatar Arman Uguray
Browse files

service: Support base switches::kV

This is a libbase built-in command-line flag to set log verbosity,
so that the VLOG macro does the right thing. This CL enables that for
the daemon. To enable VLOGs with a given verbosity level and below, do

bluetoothtbd --v=<level>

Change-Id: I128a42c52425c37640c016c3c6158419cc1c0f66
parent 13e49c60
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@ int main(int argc, char *argv[]) {
  base::AtExitManager exit_manager;
  base::CommandLine::Init(argc, argv);

  logging::LoggingSettings log_settings;
  if (!logging::InitLogging(log_settings)) {
    LOG(ERROR) << "Failed to set up logging";
    return EXIT_FAILURE;
  }

  // TODO(armansito): Initialize base/logging. By default it will dump to stdout
  // but we might want to change that based on a command-line switch. Figure out
  // how to route the logging to Android's syslog. Once that's done, we won't
+5 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include "service/settings.h"

#include <base/base_switches.h>
#include <base/command_line.h>
#include <base/logging.h>

@@ -56,7 +57,10 @@ bool Settings::Init() {
      }

      android_ipc_socket_suffix_ = suffix;
    } else {
    }
    // Check for libbase logging switches. These get processed by
    // logging::InitLogging directly.
    else if (iter.first != ::switches::kV) {
      LOG(ERROR) << "Unexpected command-line switches found";
      return false;
    }
+2 −1
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ const char kHelpMessage[] =
    "\t--android-ipc-socket-suffix\tSuffix of socket created by Android init. "
    "Mutually exclusive with --create-ipc-socket.\n"
    "\t--create-ipc-socket\t\tSocket path created for Unix domain socket based "
    "IPC. Mutually exclusive with --android-ipc-socket-suffix.\n";
    "IPC. Mutually exclusive with --android-ipc-socket-suffix.\n"
    "\t--v\t\t\t\tLog verbosity level (e.g. -v=1)\n";

}  // namespace switches
}  // namespace bluetooth