detached 10025b2

refactor(main): use structured logger instead of fmt for errors

- replaced fmt.Fprintf/Printf with log.Error for post-logger errors
- cleanup, phase registration, and installer errors now use slog
- kept fmt only for pre-logger messages (version, logger creation failure)
commit
10025b28f2deb1a72393edccc106a6f337d2be12
author
bnema · · 2025-10-26 11:26 UTC
parent
7d997b9
signature
unsigned
1 file · +3 -3
M cmd/archup-installer/main.go +3 -3
@@ -42,7 +42,7 @@ func main() {
4242 // Handle --cleanup flag
4343 if *doCleanup {
4444 if err := cleanup.Run(log); err != nil {
45- fmt.Fprintf(os.Stderr, "Cleanup failed: %v\n", err)
45+ log.Error("Cleanup failed", "error", err)
4646 os.Exit(1)
4747 }
4848 os.Exit(0)
@@ -73,7 +73,7 @@ func main() {
7373
7474 for _, phase := range phasesToRegister {
7575 if err := orchestrator.RegisterPhase(phase); err != nil {
76- fmt.Fprintf(os.Stderr, "Failed to register phase: %v\n", err)
76+ log.Error("Failed to register phase", "error", err)
7777 os.Exit(1)
7878 }
7979 }
@@ -84,7 +84,7 @@ func main() {
8484 // Run Bubbletea app
8585 p := tea.NewProgram(model, tea.WithAltScreen())
8686 if _, err := p.Run(); err != nil {
87- fmt.Printf("Error running installer: %v\n", err)
87+ log.Error("Error running installer", "error", err)
8888 os.Exit(1)
8989 }
9090 }
@@ -42,7 +42,7 @@ func main() {
42 // Handle --cleanup flag42 // Handle --cleanup flag
43 if *doCleanup {43 if *doCleanup {
44 if err := cleanup.Run(log); err != nil {44 if err := cleanup.Run(log); err != nil {
45- fmt.Fprintf(os.Stderr, "Cleanup failed: %v\n", err)45+ log.Error("Cleanup failed", "error", err)
46 os.Exit(1)46 os.Exit(1)
47 }47 }
48 os.Exit(0)48 os.Exit(0)
@@ -73,7 +73,7 @@ func main() {
73 73
74 for _, phase := range phasesToRegister {74 for _, phase := range phasesToRegister {
75 if err := orchestrator.RegisterPhase(phase); err != nil {75 if err := orchestrator.RegisterPhase(phase); err != nil {
76- fmt.Fprintf(os.Stderr, "Failed to register phase: %v\n", err)76+ log.Error("Failed to register phase", "error", err)
77 os.Exit(1)77 os.Exit(1)
78 }78 }
79 }79 }
@@ -84,7 +84,7 @@ func main() {
84 // Run Bubbletea app84 // Run Bubbletea app
85 p := tea.NewProgram(model, tea.WithAltScreen())85 p := tea.NewProgram(model, tea.WithAltScreen())
86 if _, err := p.Run(); err != nil {86 if _, err := p.Run(); err != nil {
87- fmt.Printf("Error running installer: %v\n", err)87+ log.Error("Error running installer", "error", err)
88 os.Exit(1)88 os.Exit(1)
89 }89 }
90 }90 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close