Merge lp:~chipaca/snappy/log-command-failure into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by John Lenton on 2015-05-08
Status: Merged
Approved by: John Lenton on 2015-05-18
Approved revision: 463
Merged at revision: 461
Proposed branch: lp:~chipaca/snappy/log-command-failure
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Prerequisite: lp:~chipaca/snappy/no-more-log
Diff against target: 14 lines (+4/-0)
1 file modified
cmd/snappy/main.go (+4/-0)
To merge this branch: bzr merge lp:~chipaca/snappy/log-command-failure
Reviewer Review Type Date Requested Status
Sergio Schvezov 2015-05-08 Approve on 2015-05-18
Review via email: mp+258669@code.launchpad.net

Commit Message

Log command failures.

To post a comment you must log in.
Sergio Schvezov (sergiusens) wrote :

Looks and feels like the right way to do it!

review: Approve
Michael Vogt (mvo) wrote :

Just one quick question, do we log each mistyped command this way?

On 8 May 2015 19:32:25 CEST, John Lenton <email address hidden> wrote:
>John Lenton has proposed merging lp:~chipaca/snappy/log-command-failure
>into lp:snappy with lp:~chipaca/snappy/no-more-log as a prerequisite.
>
>Commit message:
>Log command failures.
>
>Requested reviews:
> Snappy Developers (snappy-dev)
>
>For more details, see:
>https://code.launchpad.net/~chipaca/snappy/log-command-failure/+merge/258669
>--
>Your team Snappy Developers is requested to review the proposed merge
>of lp:~chipaca/snappy/log-command-failure into lp:snappy.

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

John Lenton (chipaca) wrote :

May 8 20:45:05 fogey ./snappy-go_amd64[13993]: main.go:59: DEBUG: [./snappy-go_amd64] failed: Please specify one command of: booted, build, config, firstboot, hw-assign, hw-info, hw-unassign, info, install, internal-run-hooks, internal-unpack, list, login, purge, remove, rollback, search, set, update or versions
May 8 20:45:21 fogey ./snappy-go_amd64[14000]: main.go:59: DEBUG: [./snappy-go_amd64 eppfov] failed: Unknown command `eppfov'. Please specify one command of: booted, build, config, firstboot, hw-assign, hw-info, hw-unassign, info, install, internal-run-hooks, internal-unpack, list, login, purge, remove, rollback, search, set, update or versions
May 8 20:45:31 fogey ./snappy-go_amd64[14014]: main.go:59: DEBUG: [./snappy-go_amd64 list --eppfov] failed: unknown flag `eppfov'
May 8 20:45:41 fogey ./snappy-go_amd64[14019]: main.go:59: DEBUG: [./snappy-go_amd64 install --rprworqe] failed: unknown flag `rprworqe'
May 8 20:45:47 fogey ./snappy-go_amd64[14023]: main.go:59: DEBUG: [./snappy-go_amd64 install weprpq] failed: this command requires root access. Please re-run using 'sudo'

So, before, yes.

But not now.

Michael Vogt (mvo) wrote :

Thanks and sorry for being difficult - I presume we also log "snappy install typo" type failures still? Might be a ok trade-off for the simplicity of the approach though :)

John Lenton (chipaca) wrote :

Yes, those would still get logged.

As you say, keeps things simple.

review: Approve
Snappy Tarmac (snappydevtarmac) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmd/snappy/main.go'
2--- cmd/snappy/main.go 2015-05-18 19:15:50 +0000
3+++ cmd/snappy/main.go 2015-05-18 19:15:50 +0000
4@@ -55,6 +55,10 @@
5 // the CLI user.
6 err = snappy.ErrNeedRoot
7 }
8+ if _, ok := err.(*flags.Error); !ok {
9+ // Debug, because the parser will print the error for us
10+ logger.Debugf("%v failed: %v", os.Args, err)
11+ }
12 os.Exit(1)
13 }
14 }

Subscribers

People subscribed via source and target branches