Merge pull request #328 from aluzzardi/fix-panic-eventhandler

Fix a panic that occurs in the log handler when pulling images.
This commit is contained in:
Victor Vieux 2015-01-28 14:54:59 -08:00
commit 30a5f64893
1 changed files with 6 additions and 1 deletions

View File

@ -22,7 +22,12 @@ type logHandler struct {
}
func (h *logHandler) Handle(e *cluster.Event) error {
log.WithFields(log.Fields{"node": e.Node.Name, "id": e.Id[:12], "from": e.From, "status": e.Status}).Debug("Event received")
id := e.Id
// Trim IDs to 12 chars.
if len(id) > 12 {
id = id[:12]
}
log.WithFields(log.Fields{"node": e.Node.Name, "id": id, "from": e.From, "status": e.Status}).Debug("Event received")
return nil
}