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

Delta Between Two Patch Sets: worker/uniter/jujuc/juju-log.go

Issue 6633043: jujuc: switch commands to use Context
Left Patch Set: Created 12 years, 5 months ago
Right Patch Set: jujuc: switch commands to use Context Created 12 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « worker/uniter/jujuc/interface.go ('k') | worker/uniter/jujuc/ports.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 package jujuc 1 package jujuc
2 2
3 import ( 3 import (
4 "errors" 4 "errors"
5 "launchpad.net/gnuflag" 5 "launchpad.net/gnuflag"
6 "launchpad.net/juju-core/cmd" 6 "launchpad.net/juju-core/cmd"
7 "launchpad.net/juju-core/log" 7 "launchpad.net/juju-core/log"
8 "strings" 8 "strings"
9 ) 9 )
10 10
(...skipping 22 matching lines...) Expand all
33 args = f.Args() 33 args = f.Args()
34 if args == nil { 34 if args == nil {
35 return errors.New("no message specified") 35 return errors.New("no message specified")
36 } 36 }
37 c.Message = strings.Join(args, " ") 37 c.Message = strings.Join(args, " ")
38 return nil 38 return nil
39 } 39 }
40 40
41 func (c *JujuLogCommand) Run(_ *cmd.Context) error { 41 func (c *JujuLogCommand) Run(_ *cmd.Context) error {
42 badge := c.ctx.UnitName() 42 badge := c.ctx.UnitName()
43 » if c.ctx.HasHookRelation() { 43 » if r, found := c.ctx.HookRelation(); found {
44 » » badge = badge + " " + c.ctx.HookRelation().FakeId() 44 » » badge = badge + " " + r.FakeId()
niemeyer 2012/10/09 17:33:30 (1)
45 } 45 }
46 msg := badge + ": " + c.Message 46 msg := badge + ": " + c.Message
47 if c.Debug { 47 if c.Debug {
48 log.Debugf("%s", msg) 48 log.Debugf("%s", msg)
49 } else { 49 } else {
50 log.Printf("%s", msg) 50 log.Printf("%s", msg)
51 } 51 }
52 return nil 52 return nil
53 } 53 }
LEFTRIGHT

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