tidb: Can't set the log level for tikv client caused by vendor
Please answer these questions before submitting your issue. Thanks!
- What did you do?
I’m working on tikv client benchmark.
But I realize that logrus.SetLevel()
will not take effect caused by the vendor.
- What did you expect to see?
If here is any way for me to set the log level for tikv go client client.
...
import "github.com/Sirupsen/logrus"
...
func main() {
...
logrus.SetLevel(logrus.ErrorLevel)
...
}
- What did you see instead?
nothing happened
- What version of TiDB are you using (
tidb-server -V
or runselect tidb_version();
on TiDB)?
master branch
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 45 (17 by maintainers)
@arthurkiller We don’t need a PR, the
logutil.InitLogger
function is already there, you can use it directly.@arthurkiller You can try to add a function
SetLogLevel
in a package undertidb
, then call that function in your benchmark code.If you remove “sirupsen/logrus”, and reinstall it … You may find it actually works. I usually get into trouble with my computer, so I reboot it, it work!
This case, Go use
$GOPATH/src/github.com/pingcap/tidb/vendor/github.com/sirupsen
to build the binary.In this case, Go use
$GOPATH/src/github.com/sirupsen
to build the binary.It’s Mac file system that case-insensitive, not Go.
It doesn’t work?
We provide vendor to get rid of user’s environment, and we use Makefile to control the build processing. If user break the rule, we can’t provide a repeatable build and it’s very hard to digest the problem.
sirupsen/logrus
, notSirupsen/logrus
… It’s to better to removeSirupsen/logrus
directory Upgrade your $GOPATH/src/github.com/pingcap/pd/pd-client to master, too.Try this one “github.com/sirupsen/logrus” ? @arthurkiller
So, show me the code or your repo, I can know what happened.
A suspicious place, you should
not
Sorry, I don’t get the point. @arthurkiller What do you really want to do? what’s the log output do you expected? Is the output by your program or by the tikv client library? Would you please show me your program source code?