refactor: add more logging for environment

relates to #4066
This commit is contained in:
Jan De Dobbeleer 2023-07-19 08:31:15 +02:00 committed by Jan De Dobbeleer
parent d4d6710fab
commit 5f8ae8094f

View file

@ -771,14 +771,14 @@ func (env *Shell) LoadTemplateCache() {
if !OK { if !OK {
return return
} }
var templateCache TemplateCache var tmplCache TemplateCache
err := json.Unmarshal([]byte(val), &templateCache) err := json.Unmarshal([]byte(val), &tmplCache)
if err != nil { if err != nil {
env.Error(err) env.Error(err)
return return
} }
templateCache.initialized = true tmplCache.initialized = true
env.tmplCache = &templateCache env.tmplCache = &tmplCache
} }
func (env *Shell) Logs() string { func (env *Shell) Logs() string {
@ -811,6 +811,7 @@ func (env *Shell) TemplateCache() *TemplateCache {
const separator = "=" const separator = "="
values := os.Environ() values := os.Environ()
env.DebugF("environment: %v", values)
for value := range values { for value := range values {
key, val, valid := strings.Cut(values[value], separator) key, val, valid := strings.Cut(values[value], separator)
if !valid { if !valid {