updated tmpls to use internal logger
This commit is contained in:
parent
2c58ea6895
commit
51e612a50b
2 changed files with 4 additions and 3 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"{{.ModName}}/tui"
|
"{{.ModName}}/tui"
|
||||||
|
"{{.ModName}}/internal/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
|
|
@ -13,7 +13,7 @@ var rootCmd = &cobra.Command{
|
||||||
Short: "{{.PackageName}}, {{.ProgramDesc}}",
|
Short: "{{.PackageName}}, {{.ProgramDesc}}",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := tui.Run(); err != nil {
|
if err := tui.Run(); err != nil {
|
||||||
fmt.Println("Error:", err)
|
logger.Log.Errorf("Error: %s", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package config
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
"{{.ModName}}/internal/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
|
|
@ -12,7 +13,7 @@ func Init() {
|
||||||
|
|
||||||
err := viper.ReadInConfig()
|
err := viper.ReadInConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("No config file found; using defaults.")
|
logger.Log.Info("No config file found; using defaults.")
|
||||||
}
|
}
|
||||||
|
|
||||||
viper.SetDefault("app.theme", "dark")
|
viper.SetDefault("app.theme", "dark")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue