From bfe6f073feb21cf5983678f178ea798ef10f3625 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 2 Mar 2016 19:47:00 -0800 Subject: [PATCH] Tweaks formatting of inline output messages. --- command/agent/agent_endpoint.go | 2 +- command/agent/check.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/command/agent/agent_endpoint.go b/command/agent/agent_endpoint.go index 9a64838b6..b897d5242 100644 --- a/command/agent/agent_endpoint.go +++ b/command/agent/agent_endpoint.go @@ -207,7 +207,7 @@ func (s *HTTPServer) AgentCheckUpdate(resp http.ResponseWriter, req *http.Reques total := len(update.Output) if total > CheckBufSize { - update.Output = fmt.Sprintf("%s\n...\nCaptured %d of %d bytes", + update.Output = fmt.Sprintf("%s ... (captured %d of %d bytes)", update.Output[:CheckBufSize], CheckBufSize, total) } diff --git a/command/agent/check.go b/command/agent/check.go index b82cd0544..c35d0320e 100644 --- a/command/agent/check.go +++ b/command/agent/check.go @@ -283,10 +283,10 @@ func (c *CheckTTL) getExpiredOutput() string { const prefix = "TTL expired" if c.lastOutput == "" { - return fmt.Sprintf("%s (no output was available before timeout)", prefix) + return prefix } - return fmt.Sprintf("%s (last output before timeout follows)\n\n%s", prefix, c.lastOutput) + return fmt.Sprintf("%s (last output before timeout follows): %s", prefix, c.lastOutput) } // SetStatus is used to update the status of the check,