bblfsh / bblfshd

A self-hosted server for source code parsing

Home Page:https://doc.bblf.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read the logging level from an environment var

dpordomingo opened this issue · comments

caused by https://github.com/src-d/sourced-ce/issues/142

bblfsh logging level is only configurable through command arguments, so when directly using the docker image, configuring the logging level is not that simple as changing an env value from the outside.

This seems like a reasonable request, but I would rather not have to re-implement this from first principles. What do other teams do, to support this use case?

gitbase uses go-flags, as suggested by our guides, about CLI tools

But newer gitcollector[1], ghsync[2] or borges[3] use go-cli, which already wraps go-flags and also reduces boilerplate code and helps in being more homogeneous with respect how our CLI work and look like.

@dpordomingo Thanks for the pointers! It looks like the important contribution from go-cli is bringing in go-log. @kuba-- has already started some work on migrating us over to use go-log, so hopefully we will be able to get environment support more easily.

How is the migration going?

Would it be a simple alternative something like this bblfsh/web#227?
In summary, the logging level could be read from the environment and set if no log-level arg was passed at cmd/bblfshd/main.go#L84

Doing so, it would also unblock https://github.com/src-d/backlog/issues/1485

Would it be a simple alternative something like this bblfsh/web#227?
In summary, the logging level could be read from the environment and set if no log-level arg was passed at cmd/bblfshd/main.go#L84

Doing so, it would also unblock src-d/backlog#1485

That seems like a reasonable workaround to me. It looks like the work that @kuba-- did makes this a simple enough change to make, too. See #327.

commented

Going to close this one, as it seems to be fixed by #327 and released under v2.16.1.

But please, feel free to re-open if that is not the case!