Introducing new logger, logging debug to file and info to stderr (#134)

* Introducing new logger to file debug and info to stderr
This commit is contained in:
Igor Gov
2021-07-25 10:08:37 +03:00
committed by GitHub
parent 803681a239
commit f64ee23c74
13 changed files with 112 additions and 71 deletions

View File

@@ -6,8 +6,10 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/up9inc/mizu/cli/mizu"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/homedir"
"os"
"path/filepath"
"regexp"
@@ -33,7 +35,6 @@ import (
"k8s.io/client-go/tools/clientcmd"
_ "k8s.io/client-go/tools/portforward"
watchtools "k8s.io/client-go/tools/watch"
"k8s.io/client-go/util/homedir"
)
type Provider struct {
@@ -618,6 +619,7 @@ func loadKubernetesConfiguration(kubeConfigPath string) clientcmd.ClientConfig {
kubeConfigPath = filepath.Join(home, ".kube", "config")
}
mizu.Log.Debugf("Using kube config %s", kubeConfigPath)
configPathList := filepath.SplitList(kubeConfigPath)
configLoadingRules := &clientcmd.ClientConfigLoadingRules{}
if len(configPathList) <= 1 {