Commit fa078fdd authored by Marcus's avatar Marcus Committed by lukasburgey
Browse files

Use '>' to prevent systemd from stripping leading white space from log messages

parent 4ad18a9f
...@@ -6,8 +6,9 @@ import ( ...@@ -6,8 +6,9 @@ import (
) )
var ( var (
prefix = "" // TODO this prefix should be changed to "" once we move to a systemd version which does not strip leading white spaces from our log messages
indent = " " prefix = ">"
indent = " "
) )
// Indent indents a json string if possible // Indent indents a json string if possible
......
...@@ -126,7 +126,7 @@ func (sink *Sink) handleDep(dep deps.Dep) (output scripts.Output, err error) { ...@@ -126,7 +126,7 @@ func (sink *Sink) handleDep(dep deps.Dep) (output scripts.Output, err error) {
// execute the script // execute the script
if sink.Config.Debug.Scripts { if sink.Config.Debug.Scripts {
dep.Log("Executing: '%s'", dep.Service.Command) dep.Log("Executing: '%s'", dep.Service.Command)
dep.Log("Input: %s", input) dep.Log("Input: %s", indent.Indent(iBytes))
} }
commandParts := strings.Split(dep.Service.Command, " ") commandParts := strings.Split(dep.Service.Command, " ")
...@@ -254,7 +254,7 @@ func (sink *Sink) sendReply(reply deps.Reply) (err error) { ...@@ -254,7 +254,7 @@ func (sink *Sink) sendReply(reply deps.Reply) (err error) {
} }
if sink.Config.Debug.Backend { if sink.Config.Debug.Backend {
log.Printf("Dep Response:\n%s", taskResponse) log.Printf("Dep Response: %s", indent.Indent(taskResponse))
} }
url := fmt.Sprintf("https://%s/client/dep-state", sink.Config.Hostname) url := fmt.Sprintf("https://%s/client/dep-state", sink.Config.Hostname)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment