Commit 795c3e9d authored by lukas.burgey's avatar lukas.burgey
Browse files

Add --dumb-log option

This option dump the stderr of the scripts to our log, while not being
as verbose as the --debug-scripts option.
parent 738cbc42
......@@ -53,6 +53,8 @@ type (
Sequential bool `json:"sequential_execution" yaml:"sequential_execution"`
Scripts bool `json:"scripts" yaml:"scripts"`
Backend bool `json:"backend" yaml:"backend"`
// Dump dumps all the script stderr to our log
DumpLog bool `json:"dump_log" yaml:"dump_log"`
}
// Config is the structure of our config file
......
......@@ -5,7 +5,8 @@
"debug": {
"backend": true,
"scripts": false,
"sequential_execution": false
"sequential_execution": false,
dump_log: false
},
"services": {
"<local identifier>": {
......
feudal_backend_host: "<hostname>"
feudal_backend_host: "feudal-dev.scc.kit.edu"
debug:
# dump script logging to the clients log
dump_log: true
# debug output from feudalScripts (aka feudalAdapters)
scripts: false
# debug communication with the backend
......@@ -8,19 +10,19 @@ debug:
# execute deployments in sequence and not parallel (-> nicer log output)
sequential_execution: false
username: '<username registerred at the portal>'
password: '<password registerred at the portal>'
username: 'lukas-local-test'
password: 'foobarbaz'
services:
'<local identifier>':
name: '<service name>'
description: 'This is the foo service'
command: './fooService'
command: 'stubScript'
group_to_service_ids:
'<group name>':
- '<local identifier>'
entitlement_to_service_ids:
'<entitlement string>':
'urn:geant:h-df.de:group:test-vo#login-dev.helmholtz.de':
- '<local identifier>'
......@@ -42,9 +42,10 @@ var (
validateSelector = cmdValidate.Arg("selector", "Select the schema to validate against. Options: input, output, config").Required().Enum("input", "output", "config")
configFile = app.Flag("config", "Config file to use.").Short('c').String()
scriptDebugging = app.Flag("debug-scripts", "Display debugging info concerning executed scripts").Bool()
scriptDebugging = app.Flag("debug-scripts", "Display debugging info concerning executed scripts. Implies --dump-log.").Bool()
backendDebugging = app.Flag("debug-backend", "Display debugging info concerning the backend").Bool()
debugAll = app.Flag("debug", "Display all debugging info").Bool()
dumpLog = app.Flag("dump-log", "Dump script logs into our log").Bool()
sequentialExecution = app.Flag("seq", "Execute tasks sequentially").Bool()
)
......@@ -184,6 +185,9 @@ func prepareDebugging(conf *config.Config) {
if *sequentialExecution {
conf.Debug.Sequential = true
}
if *dumpLog {
conf.Debug.DumpLog = true
}
if conf.Debug.Scripts {
log.Printf("[Debug] script debugging enabled")
......@@ -194,6 +198,9 @@ func prepareDebugging(conf *config.Config) {
if conf.Debug.Sequential {
log.Printf("[Debug] Executing tasks sequentially")
}
if conf.Debug.Scripts || conf.Debug.DumpLog {
log.Printf("[Debug] Script log dumping enabled")
}
}
// search for a config file
......
......@@ -167,7 +167,7 @@ func (sink *Sink) handleDep(dep deps.Dep) (output scripts.Output, err error) {
}
stderrBytes, _ = ioutil.ReadAll(stderr)
if sink.Config.Debug.Scripts && len(stderrBytes) > 0 {
if (sink.Config.Debug.Scripts || sink.Config.Debug.DumpLog) && len(stderrBytes) > 0 {
dep.Log("Logs:\n%s", bytes.ReplaceAll(stderrBytes, []byte("\n"), []byte("\n> ")))
dep.Log("End of Logs")
}
......
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