src-d / gitbase

SQL interface to git repositories, written in Go. https://docs.sourced.tech/gitbase
Apache License 2.0
2.07k stars 123 forks source link

Better logging #971

Closed EgorBu closed 5 years ago

EgorBu commented 5 years ago

Hi, It would be great to improve logging. For example - I tried to initialize gitbase and got:

FATA[0000] unable to initialize database engine          error="mkdir /var/lib/gitbase: permission denied"

Fortunately - I found this path in doc and changed GITBASE_INDEX_DIR. But it's definitely not obvious.

For example, it could contain a suggestion what possibly could be the reason for the error:

Error messages, and in general any feedback provided to a user in the course of interacting with your API, is part of the API. Interactivity and feedback are integral to the user experience. Design your API’s error messages deliberately.

from here.

agarciamontoro commented 5 years ago

I agree that this can be greatly improved. Your feedback here is valuable, so: what kind of message would you have liked to read there?

EgorBu commented 5 years ago

It's hard work but ideally, the error message should contain hints about how to solve the problem:

FATA[0000] bla bla
This could happen in several cases:
* try to check that you have permissions
* try to launch with sudo
* try to  change this env variable VARIABLE
erizocosmico commented 5 years ago

Waiting on https://github.com/src-d/go-mysql-server/pull/841