Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-16511

Consistent debug logging in ns_doctor.erl

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Trivial
    • 4.5.0
    • 4.5.0
    • ns_server
    • Security Level: Public
    • None

    Description

      There are two debug messages in ns_doctor, producing differently formatted output.

          ?doctor_debug("Current node statuses:~n~p",
                        [lists:sort(dict:to_list(NodeDict))]),
          {noreply, State};
      

      Produces:

      [ns_doctor:debug,2015-09-30T17:38:00.657,ns_1@host1.mydomain.com:ns_doctor<0.344.0>:ns_doctor:  handle_info:161]Current node statuses:
      [{'ns_1@host1.mydomain.com',
           [{last_heard,{1443,649080,656044}},
            {now,{1443,649080,647252}},
            {active_buckets,
                ["Bucket1","Bucket2"]},
            {ready_buckets, ... },
            { ... }]},
       {'ns_1@host2.mydomain.com',
           [{last_heard,{1443,649079,44272}},
            {now,{1443,649079,256119}},
            {active_buckets,
                ["Bucket1","Bucket2"]},
            {ready_buckets, ... },
            { ... }]}]
      

      And:

          ?doctor_debug("Got initial status ~p~n", [lists:sort(dict:to_list(Nodes))]),
          {noreply, State#state{nodes=Nodes}};
      

      Which produces:

      [ns_doctor:debug,2015-09-30T17:39:01.415,ns_1@host1.mydomain.com:ns_doctor<0.325.0>:ns_doctor:  handle_info:157]Got initial status [{'ns_1@host1.mydomain.com',
                              [{last_heard,{1443,649141,415286}},
                               {now,{1443,649141,410932}},
                               {active_buckets,[]},
                               {ready_buckets,[]},
                               {status_latency,4242},
                                :       :       :
                                :       :       :
                               {...}]}]
      
      

      The position of the linefeed makes the second one harder to parse, please change the format from:

      "Got initial status ~p~n"
      

      to:

      "Got initial status:~n~p"
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            malarky Chris Malarky
            malarky Chris Malarky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty