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:
Solomon Hykes 2014-03-25 18:19:35 -07:00
parent 4841bc9226
commit f636d3fcec

View file

@ -191,11 +191,16 @@ func GetHandler(name string) Handler {
if err != nil { if err != nil {
return return
} }
fd := -1 var msg string
if a != nil { if pretty := data.Message(string(p)).Pretty(); pretty != "" {
fd = int(a.Fd()) 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) beam.Send(out, p, a)
} }
} }