style(tools): unify console output with [I/W/E] [Module] color-coded format

- Add ANSI color coding: [I]=green, [W]=yellow, [E]=red
- Format: [Level] [Module] message with 4-char indent for data rows
- Error detail lines use |-> tree connector
- Remove extra blank lines between outputs (except list)
- Modules: CLI, Preview, Builder, Server, Watcher

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
KenanZhuandClaude Opus 4.8 committed 2026-06-05 14:21:25 +08:00
1 parent d46f702664
commit da8bb2e1a2
8 files changed
+46 -40

No files matched your search

+2 -2
View File
@@ -37,7 +37,7 @@ func runList(c *cli.Context) error {
}
absDir, _ := filepath.Abs(folder)
fmt.Printf("Available styles in '%s' (%d):\n", filepath.Base(absDir), len(themes))
fmt.Printf("\033[32m[I]\033[0m [Preview] Available styles in '%s' (%d):\n", filepath.Base(absDir), len(themes))
sort.Strings(themes)
for _, t := range themes {
@@ -51,7 +51,7 @@ func runList(c *cli.Context) error {
}
return nil
})
fmt.Printf(" %-16s (%d .tmpl files)\n", t, count)
fmt.Printf("\033[32m[I]\033[0m [Preview] %-16s (%d .tmpl files)\n", t, count)
}
return nil
}