]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/main: add --debug option
authorSamuel Just <sjust@redhat.com>
Thu, 30 May 2019 19:04:41 +0000 (12:04 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 31 May 2019 21:05:45 +0000 (14:05 -0700)
Really, what we need to do is examine the ceph conf and set
the right logger levels based on configured log levels, but
this'll suffice for now.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/main.cc

index 90b871ed246949cfa6cf3c49bf0c623c363c2ba3..6fabf7f6cc3ec99bb24186ef42d94bbe2a0355f4 100644 (file)
@@ -71,7 +71,8 @@ int main(int argc, char* argv[])
 {
   seastar::app_template app;
   app.add_options()
-    ("mkfs", "create a [new] data directory");
+    ("mkfs", "create a [new] data directory")
+    ("debug", "enable debug output on all loggers");
 
   auto [ceph_args, app_args] = partition_args(app, argv, argv + argc);
   if (ceph_argparse_need_usage(ceph_args)) {
@@ -96,6 +97,11 @@ int main(int argc, char* argv[])
     return app.run_deprecated(app_args.size(), const_cast<char**>(app_args.data()), [&] {
       auto& config = app.configuration();
       return seastar::async([&] {
+       if (config.count("debug")) {
+           seastar::global_logger_registry().set_all_loggers_level(
+             seastar::log_level::debug
+           );
+       }
         sharded_conf().start(init_params.name, cluster_name).get();
         seastar::engine().at_exit([] {
           return sharded_conf().stop();