diff --git a/cli/htmgo/tasks/astgen/writer.go b/cli/htmgo/tasks/astgen/writer.go index 8557f3f..93f5697 100644 --- a/cli/htmgo/tasks/astgen/writer.go +++ b/cli/htmgo/tasks/astgen/writer.go @@ -7,6 +7,7 @@ import ( "go/parser" "go/token" "log" + "log/slog" "os" "path/filepath" ) @@ -16,6 +17,8 @@ func WriteFile(path string, cb func(content *ast.File) string) { path = filepath.Join(currentDir, path) + slog.Debug("astgen.WriteFile", slog.String("path", path)) + dir := filepath.Dir(path) os.MkdirAll(dir, 0755) @@ -49,7 +52,7 @@ func WriteFile(path string, cb func(content *ast.File) string) { bytes, err = format.Source(bytes) if err != nil { - log.Printf("Failed to format source: %v\n\n%s", err) + log.Printf("Failed to format source: %v\n", err.Error()) data := string(bytes) println(data) return