m/c/metroctl: move common impl to m/c/m/core
This moves the implementation shared between CLI commands into metroctl
core package.
Change-Id: I93624a07356accf3441f02e6ecd8e91d5b71e66e
Reviewed-on: https://review.monogon.dev/c/monogon/+/843
Tested-by: Jenkins CI
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
diff --git a/metropolis/cli/metroctl/main.go b/metropolis/cli/metroctl/main.go
index d616714..949eb63 100644
--- a/metropolis/cli/metroctl/main.go
+++ b/metropolis/cli/metroctl/main.go
@@ -1,6 +1,7 @@
package main
import (
+ "log"
"path/filepath"
"github.com/adrg/xdg"
@@ -35,6 +36,14 @@
rootCmd.PersistentFlags().BoolVar(&flags.verbose, "verbose", false, "Log additional runtime information")
}
+// rpcLogger passes through the cluster resolver logs, if "--verbose" flag was
+// used.
+func rpcLogger(f string, args ...interface{}) {
+ if flags.verbose {
+ log.Printf("resolver: " + f, args...)
+ }
+}
+
func main() {
cobra.CheckErr(rootCmd.Execute())
}