improved found rules logging
This commit is contained in:
parent
dbdda5ed3d
commit
73eac2e1a6
1 changed files with 14 additions and 8 deletions
|
@ -38,6 +38,18 @@ func fileExists(filename string) bool {
|
||||||
return !info.IsDir()
|
return !info.IsDir()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func logHeaderConfig(config HeaderConfig) {
|
||||||
|
fmt.Println("Path: " + config.Path)
|
||||||
|
fmt.Println("FileExtension: " + config.FileExtension)
|
||||||
|
|
||||||
|
for j := 0; j < len(config.Headers); j++ {
|
||||||
|
headerRule := config.Headers[j]
|
||||||
|
fmt.Println(headerRule.Key, ":", headerRule.Value)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("------------------------------")
|
||||||
|
}
|
||||||
|
|
||||||
func initHeaderConfig() bool {
|
func initHeaderConfig() bool {
|
||||||
headerConfigValid := false
|
headerConfigValid := false
|
||||||
|
|
||||||
|
@ -54,17 +66,11 @@ func initHeaderConfig() bool {
|
||||||
if len(headerConfigs.Configs) > 0 {
|
if len(headerConfigs.Configs) > 0 {
|
||||||
headerConfigValid = true
|
headerConfigValid = true
|
||||||
fmt.Println("Found header config file. Rules:")
|
fmt.Println("Found header config file. Rules:")
|
||||||
|
fmt.Println("------------------------------")
|
||||||
|
|
||||||
for i := 0; i < len(headerConfigs.Configs); i++ {
|
for i := 0; i < len(headerConfigs.Configs); i++ {
|
||||||
configEntry := headerConfigs.Configs[i]
|
configEntry := headerConfigs.Configs[i]
|
||||||
fmt.Println("==============================================================")
|
logHeaderConfig(configEntry)
|
||||||
fmt.Println("Path: " + configEntry.Path)
|
|
||||||
fmt.Println("FileExtension: " + configEntry.FileExtension)
|
|
||||||
for j := 0; j < len(configEntry.Headers); j++ {
|
|
||||||
headerRule := configEntry.Headers[j]
|
|
||||||
fmt.Println(headerRule.Key, ":", headerRule.Value)
|
|
||||||
}
|
|
||||||
fmt.Println("==============================================================")
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("No rules found in header config file.")
|
fmt.Println("No rules found in header config file.")
|
||||||
|
|
Loading…
Reference in a new issue