Updated logger calls
This commit is contained in:
parent
8e885dd555
commit
1bd48b980f
4 changed files with 13 additions and 11 deletions
|
|
@ -3,14 +3,14 @@ package Commands
|
|||
import (
|
||||
"fmt"
|
||||
"github.com/urfave/cli/v2"
|
||||
"log"
|
||||
"lpm-cli/Tools"
|
||||
)
|
||||
|
||||
func PullCommand() *cli.Command{
|
||||
return &cli.Command {
|
||||
Name: "pull",
|
||||
Usage: "Pull a package",
|
||||
Description: "Pulls a package from the default registry server, or to a user-defined registry server.",
|
||||
Description: "Pulls a package from the a registry server.",
|
||||
HelpName: "pull",
|
||||
Action: func(c *cli.Context) error {
|
||||
//Do Stuff
|
||||
|
|
@ -19,7 +19,7 @@ func PullCommand() *cli.Command{
|
|||
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
|
||||
if err != nil {
|
||||
fmt.Printf("[ERROR] %s", err.Error())
|
||||
log.Fatal(err)
|
||||
Tools.ErrorLogger.Fatal(err)
|
||||
}
|
||||
return err
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package Commands
|
|||
import (
|
||||
"fmt"
|
||||
"github.com/urfave/cli/v2"
|
||||
"log"
|
||||
"lpm-cli/Tools"
|
||||
)
|
||||
|
||||
func PushCommand() *cli.Command {
|
||||
|
|
@ -19,7 +19,7 @@ func PushCommand() *cli.Command {
|
|||
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
|
||||
if err != nil{
|
||||
fmt.Printf("[ERROR] %s", err.Error())
|
||||
log.Fatal(err)
|
||||
Tools.ErrorLogger.Fatal(err)
|
||||
}
|
||||
return err
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package Commands
|
|||
import (
|
||||
"fmt"
|
||||
"github.com/urfave/cli/v2"
|
||||
"log"
|
||||
"lpm-cli/Tools"
|
||||
)
|
||||
|
||||
func SearchCommand() *cli.Command{
|
||||
|
|
@ -19,7 +19,7 @@ func SearchCommand() *cli.Command{
|
|||
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
|
||||
if err != nil {
|
||||
fmt.Printf("[ERROR]%s", err.Error())
|
||||
log.Fatal(err)
|
||||
Tools.ErrorLogger.Fatal(err)
|
||||
}
|
||||
return err
|
||||
},
|
||||
|
|
|
|||
12
lpm-cli.go
12
lpm-cli.go
|
|
@ -2,15 +2,17 @@ package main
|
|||
|
||||
import (
|
||||
"github.com/urfave/cli/v2"
|
||||
"log"
|
||||
"lpm-cli/Commands"
|
||||
"lpm-cli/Informations"
|
||||
"lpm-cli/Tools"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
||||
|
||||
func main() {
|
||||
|
||||
Tools.LoggerInit()
|
||||
|
||||
Tools.InfoLogger.Printf("Lotus-PM was executed")
|
||||
app := &cli.App {
|
||||
Name: "lotus-pm",
|
||||
Usage: "Lotus Package Manager",
|
||||
|
|
@ -20,12 +22,12 @@ func main(){
|
|||
Commands.PushCommand(),
|
||||
Commands.PullCommand(),
|
||||
Commands.SearchCommand(),
|
||||
Commands.ListCommand(),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
Tools.ErrorLogger.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in a new issue