Updated logging

This commit is contained in:
netbenix 2021-11-06 20:55:55 +01:00
parent 8f60c9ce7c
commit ff9e4b3e3a
8 changed files with 106 additions and 30 deletions

View file

@ -1,12 +1,15 @@
package Commands
import (
"fmt"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"lpm-cli/Tools"
"lpm-cli/Lotus"
)
func PushCommand() *cli.Command {
func NewPushCommand() *cli.Command {
logger := Lotus.CreateLogger("pushCommand", logrus.WarnLevel)
return &cli.Command {
Name: "push",
Usage: "Push a package",
@ -18,8 +21,7 @@ func PushCommand() *cli.Command {
},
OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
if err != nil{
fmt.Printf("[ERROR] %s", err.Error())
Tools.ErrorLogger.Fatal(err)
logger.Fatal(err)
}
return err
},