Merge lp:~jamesodhunt/snappy/log-commands-that-change-system-state into lp:~snappy-dev/snappy/snappy-moved-to-github
| Status: | Work in progress |
|---|---|
| Proposed branch: | lp:~jamesodhunt/snappy/log-commands-that-change-system-state |
| Merge into: | lp:~snappy-dev/snappy/snappy-moved-to-github |
| Diff against target: |
351 lines (+120/-9) 12 files modified
cmd/snappy-go/cmd_booted.go (+12/-1) cmd/snappy-go/cmd_hwassign.go (+8/-1) cmd/snappy-go/cmd_hwunassign.go (+8/-1) cmd/snappy-go/cmd_rollback.go (+8/-1) cmd/snappy-go/cmd_update.go (+4/-0) partition/partition.go (+16/-0) partition/partition_test.go (+3/-0) snappy/click.go (+4/-0) snappy/install.go (+9/-1) snappy/snapp.go (+9/-1) snappy/systemimage.go (+31/-3) snappy/systemimage_test.go (+8/-0) |
| To merge this branch: | bzr merge lp:~jamesodhunt/snappy/log-commands-that-change-system-state |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| John Lenton | 2015-03-27 | Disapprove on 2015-04-13 | |
| Michael Vogt | Needs Information on 2015-03-31 | ||
| Sergio Schvezov | 2015-04-10 | Pending | |
|
Review via email:
|
|||
Description of the Change
* Added logging calls for commands that modify the system state.
* partition/
- Added RootfsLabel() and OtherRootfsLabel() implementations to enable
rich log messages.
* Upated tests for new functions.
This branch was rather awkward given the way we handle clicks and s-i parts differently. I've tried to keep the log calls as "high up" in the calling stack as possible, but on occasion you'll see that I had to dive down a little lower than desired to fit in with the current code structure.
Note too that there is a small amount of duplication in the logging output:
a) Installing and then removing a snap gives the following:
INFO:snappy:
INFO:snappy:
INFO:snappy:
Which of the 2 "Installed" message do we want to keep?
b) s-i parts:
INFO:snappy:
INFO:snappy:
INFO:snappy:
I wonder if we could retain all the s-i messages since:
a) An installed message should be provided for all parts.
b) The other 2 Updated messages are useful as they provide details of the partition (essential IMHO).
| Michael Vogt (mvo) wrote : | # |
Thanks for working on this!
I started reviewing this branch but I think this needs a quick sync with Sergio before I continue. By doing most of the logging in cmd/snappy webdm will have to duplicate that code.
It seems worthwhile to talk about moving the cmd/ bits into snappy/partition so that he automatically benefits.
I still have some inline comments, it seems like there is value in extracting some of the common pattern(s) into helpers.
| John Lenton (chipaca) wrote : | # |
So, talking with mvo and sergiusens, we need to change the approach entirely: we need to change cmd_* to be as simple as possible, and pass loggers (and the other bits) into the library for the library itself to do the logging on the passed in loggers.
Unmerged revisions
- 268. By James Hunt on 2015-03-27
-
* Sync with lp:snappy.
- 267. By James Hunt on 2015-03-27
-
* Added logging calls for commands that modify the system state.
* partition/partition. go:
- Added RootfsLabel() and OtherRootfsLabel() implementations to enable
rich log messages.
* Upated tests for new functions.


I don't have answers to your questions (is an MP the right place to ask the questions? are you really asking, or is it your way of exploring future work?). But the branch looks good.