From 1dd1e7339b15402f15008c4ae5ea65e81ac3b9c9 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Thu, 29 Jan 2015 00:44:28 -0800 Subject: [PATCH] feat(eventlog) add SetError to EventInProgress --- thirdparty/eventlog/log.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/thirdparty/eventlog/log.go b/thirdparty/eventlog/log.go index d24ace197..f25fc92c9 100644 --- a/thirdparty/eventlog/log.go +++ b/thirdparty/eventlog/log.go @@ -120,6 +120,13 @@ func (eip EventInProgress) Append(l Loggable) { eip.loggables = append(eip.loggables, l) } +// SetError includes the provided error +func (eip EventInProgress) SetError(err error) { + eip.loggables = append(eip.loggables, LoggableMap{ + "error": err.Error(), + }) +} + // Done creates a new Event entry that includes the duration and appended // loggables. func (eip EventInProgress) Done() {