[astute] Pretty debug output

Bug #1352854 reported by Vladimir Sharshov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Medium
Maciej Kwiek
7.0.x
Won't Fix
Medium
Vladimir Sharshov

Bug Description

Show pretty logs for Astute debug. This change will help save time to analyze and debug problem.

Example.

Instead of:

2014-08-04T11:48:46 debug: [375] 8ae326ed-deb0-48ce-8175-53673d972785: MC agent 'puppetd', method 'last_run_summary', results: {:sender=>"4", :statuscode=>0, :statusmsg=>"OK", :data=>{:output=>"Currently stopped; last completed run 0 seconds ago", :status=>"stopped", :err_msg=>"Process not running but not empty lockfile is present. Trying to remove lockfile...ok.", :runtime=>0, :enabled=>1, :events=>{"failure"=>0, "success"=>212, "total"=>212}, :idling=>0, :version=>{"puppet"=>"3.4.2", "config"=>1407149210}, :stopped=>1, :resources=>{"out_of_sync"=>205, "failed"=>0, "changed"=>205, "scheduled"=>0, "restarted"=>11, "skipped"=>0, "failed_to_restart"=>0, "total"=>287}, :lastrun=>1407149326, :time=>{"anchor"=>0.0877560000000001, "install_ssh_keys"=>0.001511, "firewall"=>5.71379, "nova_config"=>0.097807, "file"=>0.213006, "augeas"=>0.487131, "exec"=>1.381644, "service"=>0.467128, "last_run"=>1407149326, "group"=>0.035449, "package"=>66.790824, "sysctl"=>0.008702, "host"=>0.098689, "user"=>0.036711, "nova_paste_api_ini"=>0.017611, "filebucket"=>8.8e-05, "l3_if_downup"=>0.000632, "config_retrieval"=>3.418378, "notify"=>0.010566, "file_line"=>0.002777, "schedule"=>0.000563, "total"=>78.870763}, :running=>0, :changes=>{"total"=>212}}}

show:

2014-08-04T11:48:46 debug: [375] 8ae326ed-deb0-48ce-8175-53673d972785: MC agent 'puppetd', method 'last_run_summary', results: {:sender=>"4",
 :statuscode=>0,
 :statusmsg=>"OK",
 :data=>
  {:output=>"Currently stopped; last completed run 0 seconds ago",
   :status=>"stopped",
   :err_msg=>
    "Process not running but not empty lockfile is present. Trying to remove lockfile...ok.",
   :runtime=>0,
   :enabled=>1,
   :events=>{"failure"=>0, "success"=>212, "total"=>212},
   :idling=>0,
   :version=>{"puppet"=>"3.4.2", "config"=>1407149210},
   :stopped=>1,
   :resources=>
    {"out_of_sync"=>205,
     "failed"=>0,
     "changed"=>205,
     "scheduled"=>0,
     "restarted"=>11,
     "skipped"=>0,
     "failed_to_restart"=>0,
     "total"=>287},
   :lastrun=>1407149326,
   :time=>
    {"anchor"=>0.0877560000000001,
     "install_ssh_keys"=>0.001511,
     "firewall"=>5.71379,
     "nova_config"=>0.097807,
     "file"=>0.213006,
     "augeas"=>0.487131,
     "exec"=>1.381644,
     "service"=>0.467128,
     "last_run"=>1407149326,
     "group"=>0.035449,
     "package"=>66.790824,
     "sysctl"=>0.008702,
     "host"=>0.098689,
     "user"=>0.036711,
     "nova_paste_api_ini"=>0.017611,
     "filebucket"=>8.8e-05,
     "l3_if_downup"=>0.000632,
     "config_retrieval"=>3.418378,
     "notify"=>0.010566,
     "file_line"=>0.002777,
     "schedule"=>0.000563,
     "total"=>78.870763},
   :running=>0,
   :changes=>{"total"=>212}}}

description: updated
Revision history for this message
Vladimir Sharshov (vsharshov) wrote :

Example of new pretty logs.

Changed in fuel:
milestone: 5.1 → 6.0
Revision history for this message
Dmitry Borodaenko (angdraug) wrote :

No progress for 3 months, resetting back to Triaged.

Changed in fuel:
status: In Progress → Triaged
Changed in fuel:
milestone: 6.0 → 6.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-astute (master)

Change abandoned by Vladimir Sharshov (<email address hidden>) on branch: master
Review: https://review.openstack.org/111972

Revision history for this message
Vladimir Sharshov (vsharshov) wrote :

Moved to 7.0

tags: added: module-astute
removed: astute
Changed in fuel:
milestone: 6.1 → 7.0
Revision history for this message
Vladimir Sharshov (vsharshov) wrote :

I suggest to move it to 8.0, because it is a small feature.

tags: added: feature
Changed in fuel:
milestone: 7.0 → 8.0
Changed in fuel:
milestone: 7.0 → 8.0
assignee: Vladimir Sharshov (vsharshov) → Fuel Python Team (fuel-python)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Maciej Kwiek (maciej-iai)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-astute (master)

Fix proposed to branch: master
Review: https://review.openstack.org/220973

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-astute (master)

Reviewed: https://review.openstack.org/220973
Committed: https://git.openstack.org/cgit/stackforge/fuel-astute/commit/?id=828ad0785479afc816b3ac2f9f14202bddac467d
Submitter: Jenkins
Branch: master

commit 828ad0785479afc816b3ac2f9f14202bddac467d
Author: Maciej Kwiek <email address hidden>
Date: Mon Sep 7 14:21:11 2015 +0200

    Change inspect to pretty_inspect in logs

    pretty_inspect output makes it easier to read logs.

    Closes-Bug: #1352854
    Implements blueprint: astute-pretty-logging

    Change-Id: Ibd931d1f31c0ef6a5747d081ac2bf0d2596ae8b2

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Artem Hrechanychenko (agrechanichenko) wrote :

Verified on ISO #107

Pretty output in debug doesn't work for "escape sequences" with \n, and single and double quotes

http://paste.openstack.org/show/475296/
http://paste.openstack.org/show/475297/
http://paste.openstack.org/show/475298/

Dmitry Pyzhov (dpyzhov)
no longer affects: fuel/8.0.x
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Revision history for this message
Maciej Kwiek (maciej-iai) wrote :

@Artem: it doesn't really make sense to look for escaped sequences in every logged value.

You can file new bugs for these specific places, so the logs will look better, but in my opinion this is the problem with values being passed to logging, not with the logging method - so it's out of scope of this bug. I will mark this one back as fix committed.

Changed in fuel:
status: Triaged → Fix Committed
Revision history for this message
Artem Hrechanychenko (agrechanichenko) wrote :

Agree.
Mark as fix released

Changed in fuel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.