提交 8388e7dc 编写于 作者: M Matt Rickard 提交者: GitHub

Merge pull request #894 from r2d4/showlib

Deprecate show-libmachine-logs flag
......@@ -79,10 +79,6 @@ var settings = []Setting{
validations: []setFn{IsPositive},
callbacks: []setFn{RequiresRestartMsg},
},
{
name: "show-libmachine-logs",
set: SetBool,
},
{
name: "log_dir",
set: SetString,
......
......@@ -18,6 +18,7 @@ package cmd
import (
goflag "flag"
"fmt"
"io/ioutil"
"os"
"strings"
......@@ -73,15 +74,24 @@ var RootCmd = &cobra.Command{
}
}
shouldShowLibmachineLogs := viper.GetBool(showLibmachineLogs)
if glog.V(3) {
log.SetDebug(true)
if viper.GetBool(showLibmachineLogs) {
fmt.Println(`
--show-libmachine-logs is deprecated.
Please use --v=3 to show libmachine logs, and --v=7 for debug level libmachine logs
`)
}
if !shouldShowLibmachineLogs {
// Log level 3 or greater enables libmachine logs
if !glog.V(3) {
log.SetOutWriter(ioutil.Discard)
log.SetErrWriter(ioutil.Discard)
}
// Log level 7 or greater enables debug level logs
if glog.V(7) {
log.SetDebug(true)
}
if enableUpdateNotification {
notify.MaybePrintUpdateTextFromGithub(os.Stdout)
}
......@@ -117,7 +127,7 @@ func setFlagsUsingViper() {
}
func init() {
RootCmd.PersistentFlags().Bool(showLibmachineLogs, false, "Whether or not to show logs from libmachine.")
RootCmd.PersistentFlags().Bool(showLibmachineLogs, false, "Deprecated: To enable libmachine logs, set --v=3 or higher")
RootCmd.AddCommand(configCmd.ConfigCmd)
RootCmd.AddCommand(configCmd.AddonsCmd)
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
......@@ -144,7 +154,7 @@ func initConfig() {
func setupViper() {
viper.SetEnvPrefix(constants.MinikubeEnvPrefix)
// Replaces '-' in flags with '_' in env variables
// e.g. show-libmachine-logs => $ENVPREFIX_SHOW_LIBMACHINE_LOGS
// e.g. iso-url => $ENVPREFIX_ISO_URL
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
viper.AutomaticEnv()
......
......@@ -14,7 +14,7 @@ Minikube is a CLI tool that provisions and manages single-node Kubernetes cluste
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -26,7 +26,7 @@ For the list of accessible variables for the template, see the struct values her
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube addons disable ADDON_NAME
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube addons enable ADDON_NAME
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube addons list
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -26,7 +26,7 @@ minikube addons open ADDON_NAME
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -33,7 +33,7 @@ minikube completion SHELL
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -14,7 +14,6 @@ Configurable fields:
* disk-size
* host-only-cidr
* memory
* show-libmachine-logs
* log_dir
* kubernetes-version
* iso-url
......@@ -41,7 +40,7 @@ minikube config SUBCOMMAND [flags]
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube config get PROPERTY_NAME
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -19,7 +19,7 @@ minikube config set PROPERTY_NAME PROPERTY_VALUE
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube config unset PROPERTY_NAME
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -26,7 +26,7 @@ For the list of accessible variables for the template, see the struct values her
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -24,7 +24,7 @@ minikube dashboard
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -19,7 +19,7 @@ minikube delete
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -26,7 +26,7 @@ minikube docker-env
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube get-k8s-versions
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube ip
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube logs
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -27,7 +27,7 @@ minikube service [flags] SERVICE
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -25,7 +25,7 @@ minikube service list [flags]
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube ssh
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -42,7 +42,7 @@ minikube start
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -27,7 +27,7 @@ localkube: {{.LocalkubeStatus}}
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -19,7 +19,7 @@ minikube stop
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
......@@ -18,7 +18,7 @@ minikube version
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--show-libmachine-logs Deprecated: To enable libmachine logs, set --v=3 or higher
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册