refactor: use slog instead of log
This commit is contained in:
parent
fcffccc145
commit
d8743e54c1
8 changed files with 180 additions and 165 deletions
8
main.go
8
main.go
|
|
@ -1,18 +1,20 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app, err := NewApp()
|
||||
if err != nil {
|
||||
log.Fatalf("ERROR: Unable to setup application: %v", err)
|
||||
slog.Error(fmt.Sprintf("Unable to setup application: %v", err))
|
||||
os.Exit(1)
|
||||
}
|
||||
defer func() {
|
||||
if err := app.Close(); err != nil {
|
||||
log.Printf("ERROR: Failed to close application resources: %v", err)
|
||||
slog.Error(fmt.Sprintf("Failed to close application resources: %v", err))
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue