Maintenance: upgrade golibs (affects logger)
This commit is contained in:
@@ -4,14 +4,15 @@ package cli
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/os"
|
||||
)
|
||||
|
||||
type CLI interface {
|
||||
ClientKey(args []string, openFile os.OpenFileFunc) error
|
||||
HealthCheck(ctx context.Context) error
|
||||
OpenvpnConfig(os os.OS) error
|
||||
Update(ctx context.Context, args []string, os os.OS) error
|
||||
OpenvpnConfig(os os.OS, logger logging.Logger) error
|
||||
Update(ctx context.Context, args []string, os os.OS, logger logging.Logger) error
|
||||
}
|
||||
|
||||
type cli struct{}
|
||||
|
||||
@@ -14,9 +14,7 @@ import (
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
func (c *cli) OpenvpnConfig(os os.OS) error {
|
||||
logger := logging.New(logging.StdLog)
|
||||
|
||||
func (c *cli) OpenvpnConfig(os os.OS, logger logging.Logger) error {
|
||||
var allSettings configuration.Settings
|
||||
err := allSettings.Read(params.NewEnv(), os, logger)
|
||||
if err != nil {
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
"github.com/qdm12/golibs/os"
|
||||
)
|
||||
|
||||
func (c *cli) Update(ctx context.Context, args []string, os os.OS) error {
|
||||
func (c *cli) Update(ctx context.Context, args []string, os os.OS, logger logging.Logger) error {
|
||||
options := configuration.Updater{CLI: true}
|
||||
var flushToFile bool
|
||||
flagSet := flag.NewFlagSet("update", flag.ExitOnError)
|
||||
@@ -39,7 +39,6 @@ func (c *cli) Update(ctx context.Context, args []string, os os.OS) error {
|
||||
if err := flagSet.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
logger := logging.New(logging.StdLog)
|
||||
if !flushToFile && !options.Stdout {
|
||||
return fmt.Errorf("at least one of -file or -stdout must be specified")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user