Skip to content

Commit

Permalink
Adjust logging in simer.
Browse files Browse the repository at this point in the history
Signed-off-by: Rule Timothy (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Mar 27, 2024
1 parent 5135411 commit bb43bd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions extra/tools/simer/internal/pkg/file/handler/kind/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ func (h *YamlKindHandler) Detect(file string) any {
if err == io.EOF {
break
}
slog.Error(fmt.Sprintf("Decode error; file=%s", file))
slog.Error(err.Error())
slog.Debug(fmt.Sprintf("Decode error; file=%s (%s)", file, err.Error()))
continue
}
doc.File = file
Expand Down
3 changes: 3 additions & 0 deletions extra/tools/simer/internal/pkg/index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
package index

import (
"fmt"
"io/fs"
"log/slog"
"os"
"path/filepath"
)
Expand All @@ -14,6 +16,7 @@ func IndexFiles(path string, extension string) ([]string, error) {
files := []string{}
fileSystem := os.DirFS(".")
err := fs.WalkDir(fileSystem, path, func(s string, d fs.DirEntry, e error) error {
slog.Debug(fmt.Sprintf("IndexFiles: %s (%t, %s)", s, d.IsDir(), filepath.Ext(s)))
if !d.IsDir() && filepath.Ext(s) == extension {
files = append(files, s)
}
Expand Down

0 comments on commit bb43bd4

Please sign in to comment.