Open mkevac opened 1 year ago
Gentle ping. This is quite annoying, and a fix seems not that complicated (as long as someone can commit https://github.com/dgraph-io/ristretto/pull/293 )
Less gentle ping. :innocent:
This package is a 4th-degree dependency of my application. I'm surprised to see CLI flags and panics that are out of my control.
This is bizarre to me as glog even states in its README that it's only for internal use at Google (why it is even public is beyond me):
The repository contains an open source version of the log package used inside Google. The master copy of the source lives inside Google, not here. The code in this repo is for export only and is not itself under development. Feature requests will be ignored.
Can we at least get some acknowledgement from @dgraph-io that this dependency will be removed?
Ristretto has a change merged that removes glog. As soon as we do a new release, we should upgrade ristretto in badger.
Just for the sake of better "full-text findability". Besides -v
glog also silently adds these command line flags to programs using badger v4
-alsologtostderr
log to standard error as well as files
-log_backtrace_at value
when logging hits line file:N, emit a stack trace
-log_dir string
If non-empty, write log files in this directory
-logtostderr
log to standard error instead of files
-stderrthreshold value
logs at or above this threshold go to stderr
-v value
log level for V logs
-vmodule value
comma-separated list of pattern=N settings for file-filtered logging
Will this be addressed? I'd really like to get rid of the extra flags that are being added by using badger v4... Is there any known way to remove them?
EDIT: I found a way, you can declare your own flag set with flag.NewFlagSet("flagsetname", flag.ExitOnError)
and use that instead of default...
This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.
Please keep it open.
What version of Badger are you using?
v4.0.1
What version of Go are you using?
Not relevant
Have you tried reproducing the issue with the latest release?
Yes
What is the hardware spec (RAM, CPU, OS)?
Not relevant
What steps will reproduce the bug?
Use badger in an app that has
-v
flag.Expected behavior and actual result.
Expected: program does not panic. Actual: program panics.
This is because glog library pollutes flags and adds
-v
flag. This breaks every program that has-v
flag. Library should not pollute global flags.Dependency graph
See relevant issues: https://github.com/DataDog/dd-trace-go/issues/1153 https://github.com/dgraph-io/ristretto/pull/293
Additional information
Ristretto is abandoned and they will not remove glog dependency. Consider moving to ristretto fork.