Skip to content

Commit

Permalink
Remove additional / uneeded logging flags
Browse files Browse the repository at this point in the history
**What type of PR is this?**
> Uncomment only one ` /kind` line, and delete the rest.
> For example, `> /kind bug` would simply become: `/kind bug`

/kind cleanup

**What does does this PR do / why we need it**:

This PR removes additional logging flags that are not needed as well as
unused by odo.

So `odo --help` now looks like this:

```sh
Flags:
      --complete             Install completion for odo command
      --uncomplete           Uninstall completion for odo command
  -v, --v Level              Number for the log level verbosity. Level varies from 0 to 9 (default 0).
      --vmodule moduleSpec   Comma-separated list of pattern=N settings for file-filtered logging
  -y, --y                    Don't prompt user for typing 'yes' when installing completion
```

**Which issue(s) this PR fixes**:

Fixes redhat-developer#3446

**How to test changes / Special notes to the reviewer**:

Run:

```sh
odo --help
```

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
  • Loading branch information
cdrage committed Jul 17, 2020
1 parent d33b52e commit 378f4b8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
21 changes: 13 additions & 8 deletions docs/dev/logging.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Logging in `odo`

https://godoc.org/k8s.io/klog[Glog] is used for V style logging in `odo`.
https://github.com/kubernetes/klog[Klog] is used for V style logging in `odo`.

== Working

Expand All @@ -12,7 +12,7 @@ All ERROR severity level log messages will always be logged regardless of the va

== Usage

Every source file that requires logging will need to import glog:
Every source file that requires logging will need to import klog:

----
$ import "k8s.io/klog"
Expand Down Expand Up @@ -42,11 +42,16 @@ $ klog.Warningf(msg, args...)
In addition to the above logging, the following hidden flags are available for debugging:

----
--alsologtostderr log to standard error as well as files
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--add_dir_header If true, adds the file directory to the header
--alsologtostderr Log to standard error as well as files
--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
--logtostderr log to standard error instead of files (default false)
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs. Level varies from 0 to 9 (default 0).
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr Log to standard error instead of files (default true)
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
--stderrthreshold severity Logs at or above this threshold go to stderr (default 2)
-v, --v Level Number for the log level verbosity. Level varies from 0 to 9 (default 0).
--vmodule moduleSpec Comma-separated list of pattern=N settings for file-filtered logging
----
5 changes: 5 additions & 0 deletions pkg/odo/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ func odoRootCmd(name, fullName string) *cobra.Command {
_ = pflag.CommandLine.MarkHidden("log_dir")
_ = pflag.CommandLine.MarkHidden("logtostderr")
_ = pflag.CommandLine.MarkHidden("stderrthreshold")
_ = pflag.CommandLine.MarkHidden("add_dir_header")
_ = pflag.CommandLine.MarkHidden("log_file")
_ = pflag.CommandLine.MarkHidden("log_file_max_size")
_ = pflag.CommandLine.MarkHidden("skip_headers")
_ = pflag.CommandLine.MarkHidden("skip_log_headers")

// We will mark the command as hidden and then re-enable if the command
// supports json output
Expand Down

0 comments on commit 378f4b8

Please sign in to comment.