Skip to content

Commit

Permalink
chore: properly log loaded env
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvc committed Jul 18, 2023
1 parent 52cb8cb commit f85ce02
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/template/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
type environment any

func loadEnvironment(input []byte, forceJSON, forceTOML, forceYAML bool) environment {
log.Default().SetLevel(log.DebugLevel)
var env environment

if len(input) > 0 && input[0] == '@' {
Expand Down Expand Up @@ -57,7 +56,7 @@ func loadEnvironment(input []byte, forceJSON, forceTOML, forceYAML bool) environ

func loadJSONEnvironment(input []byte, env *environment) error {
if err := json.Unmarshal(input, &env); err == nil {
log.Debug("Loaded JSON environment", "env", env)
log.Debug("Loaded JSON environment", "env", *env)
return nil
} else {
log.Debug("Error parsing JSON", "error", err)
Expand All @@ -67,7 +66,7 @@ func loadJSONEnvironment(input []byte, env *environment) error {

func loadTOMLEnvironment(input []byte, env *environment) error {
if err := toml.Unmarshal(input, &env); err == nil {
log.Debug("Loaded TOML environment", "env", env)
log.Debug("Loaded TOML environment", "env", *env)
return nil
} else {
log.Debug("Error parsing TOML", "error", err)
Expand All @@ -77,7 +76,7 @@ func loadTOMLEnvironment(input []byte, env *environment) error {

func loadYAMLEnvironment(input []byte, env *environment) error {
if err := yaml.Unmarshal(input, &env); err == nil {
log.Debug("Loaded YAML environment", "env", env)
log.Debug("Loaded YAML environment", "env", *env)
return nil
} else {
log.Debug("Error parsing YAML", "error", err)
Expand Down

0 comments on commit f85ce02

Please sign in to comment.