mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
beam/examples/beamsh: prettier 'trace' command
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
This commit is contained in:
parent
eca6fecb59
commit
d7a2ae8e13
1 changed files with 9 additions and 4 deletions
|
@ -191,11 +191,16 @@ func GetHandler(name string) Handler {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
fd := -1
|
||||
if a != nil {
|
||||
fd = int(a.Fd())
|
||||
var msg string
|
||||
if pretty := data.Message(string(p)).Pretty(); pretty != "" {
|
||||
msg = pretty
|
||||
} else {
|
||||
msg = string(p)
|
||||
}
|
||||
fmt.Printf("===> [TRACE] %s [%d]\n", p, fd)
|
||||
if a != nil {
|
||||
msg = fmt.Sprintf("%s [%d]", msg, a.Fd())
|
||||
}
|
||||
fmt.Printf("===> %s\n", msg)
|
||||
beam.Send(out, p, a)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue