Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4374)

Issue 7379050: Add and use a log_hook context manager.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by frankban
Modified:
11 years, 2 months ago
Reviewers:
mp+150413, gary.poster
Visibility:
Public.

Description

Add and use a log_hook context manager. Replace the current calls to log_entry and log_exit in the __main__ of the hooks with a log_hook context manager, simplifying the code a bit. Avoiding log_entry and log_exit also temporarily works around a problem they have with the juju-core handling of strings starting with "--" in juju-log. https://code.launchpad.net/~frankban/charms/precise/juju-gui/bug-1132905-log-hook/+merge/150413 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add and use a log_hook context manager. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -41 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M hooks/config-changed View 3 chunks +2 lines, -11 lines 0 comments Download
M hooks/install View 4 chunks +4 lines, -14 lines 0 comments Download
M hooks/start View 2 chunks +2 lines, -6 lines 0 comments Download
M hooks/stop View 2 chunks +6 lines, -10 lines 0 comments Download
M hooks/utils.py View 4 chunks +23 lines, -0 lines 0 comments Download
M tests/test_utils.py View 3 chunks +46 lines, -0 lines 0 comments Download

Messages

Total messages: 3
frankban
Please take a look.
11 years, 2 months ago (2013-02-25 19:10:18 UTC) #1
gary.poster
LGTM. Nice tests. Thanks! https://codereview.appspot.com/7379050/diff/1/hooks/config-changed File hooks/config-changed (right): https://codereview.appspot.com/7379050/diff/1/hooks/config-changed#newcode135 hooks/config-changed:135: with log_hook(): Nice!
11 years, 2 months ago (2013-02-25 23:37:21 UTC) #2
frankban
11 years, 2 months ago (2013-02-26 09:32:48 UTC) #3
*** Submitted:

Add and use a log_hook context manager.

Replace the current calls to log_entry and log_exit in the __main__ of
the hooks with a log_hook context manager, simplifying the code a bit.

Avoiding log_entry and log_exit also temporarily works around a problem
they have with the juju-core handling of strings starting with "--" in
juju-log.

R=gary.poster
CC=
https://codereview.appspot.com/7379050
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b