summaryrefslogtreecommitdiff
path: root/caddyconfig/caddyfile/importargs.go
diff options
context:
space:
mode:
authorWeidiDeng <weidi_deng@icloud.com>2023-05-26 03:05:00 +0800
committerGitHub <noreply@github.com>2023-05-25 13:05:00 -0600
commit9cde71552576dcc724eff38dee42879c927b72ec (patch)
tree5af6bec905fadbc7ef0f9d8be610f7ffe3758682 /caddyconfig/caddyfile/importargs.go
parent942fbb37ec46f1907e57a04c44ca790bd47ed52c (diff)
caddyfile: Track import name instead of modifying filename (#5540)
* Merge branch 'master' into import_file_stack * remove space in log key
Diffstat (limited to 'caddyconfig/caddyfile/importargs.go')
-rw-r--r--caddyconfig/caddyfile/importargs.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/caddyconfig/caddyfile/importargs.go b/caddyconfig/caddyfile/importargs.go
index 53725a1..c6dcd85 100644
--- a/caddyconfig/caddyfile/importargs.go
+++ b/caddyconfig/caddyfile/importargs.go
@@ -39,7 +39,7 @@ func parseVariadic(token Token, argCount int) (bool, int, int) {
if argRange == "" {
caddy.Log().Named("caddyfile").Warn(
"Placeholder "+token.Text+" cannot have an empty index",
- zap.String("file", token.File+":"+strconv.Itoa(token.Line)))
+ zap.String("file", token.File+":"+strconv.Itoa(token.Line)), zap.Strings("import_chain", token.imports))
return false, 0, 0
}
@@ -61,7 +61,7 @@ func parseVariadic(token Token, argCount int) (bool, int, int) {
if err != nil {
caddy.Log().Named("caddyfile").Warn(
"Variadic placeholder "+token.Text+" has an invalid start index",
- zap.String("file", token.File+":"+strconv.Itoa(token.Line)))
+ zap.String("file", token.File+":"+strconv.Itoa(token.Line)), zap.Strings("import_chain", token.imports))
return false, 0, 0
}
}
@@ -70,7 +70,7 @@ func parseVariadic(token Token, argCount int) (bool, int, int) {
if err != nil {
caddy.Log().Named("caddyfile").Warn(
"Variadic placeholder "+token.Text+" has an invalid end index",
- zap.String("file", token.File+":"+strconv.Itoa(token.Line)))
+ zap.String("file", token.File+":"+strconv.Itoa(token.Line)), zap.Strings("import_chain", token.imports))
return false, 0, 0
}
}
@@ -79,7 +79,7 @@ func parseVariadic(token Token, argCount int) (bool, int, int) {
if startIndex < 0 || startIndex > endIndex || endIndex > argCount {
caddy.Log().Named("caddyfile").Warn(
"Variadic placeholder "+token.Text+" indices are out of bounds, only "+strconv.Itoa(argCount)+" argument(s) exist",
- zap.String("file", token.File+":"+strconv.Itoa(token.Line)))
+ zap.String("file", token.File+":"+strconv.Itoa(token.Line)), zap.Strings("import_chain", token.imports))
return false, 0, 0
}
return true, startIndex, endIndex