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
@@ -49,7 +49,7 @@ func runCreate(c *cli.Context) error {
if info, err := os.Stat(styleDir); err == nil {
if info.IsDir() {
fmt.Printf(" [skip] '%s' already exists\n", styleName)
fmt.Printf("\033[32m[I]\033[0m [CLI] '%s' already exists, skipped\n", styleName)
continue
}
return fmt.Errorf("'%s' exists but is not a directory", styleName)
@@ -79,7 +79,7 @@ func runCreate(c *cli.Context) error {
created++
}
fmt.Printf(" Created style '%s' with %d template files\n", styleName, created)
fmt.Printf("\033[32m[I]\033[0m [CLI] Created style '%s' with %d template files\n", styleName, created)
}
return nil