orhun/flawz

Add logging

Opened this issue · 2 comments

Is your feature request related to a problem? Please describe.

nvd_cve crate shows some logs regarding the fetched feeds but flawz do not use any logging.

Describe the solution you'd like

We can initialize logging via crates env_logger or tracing crates and log the following information at startup:

  • Database location (debug)
  • Fetched feeds (info)
  • Database URL
  • And so on.

Describe alternatives you've considered

None.

Additional context

Just for context, nvd_cve logs the feed info as follows:

image

In my case I'm encountering errors, but only for the 2020 and 2021 feeds:

❯ flawz --feeds 2020 --force-update
[Feed: 2020] Fetching feed (5.58 MB)              [-----------------------------]   0%
Error: CacheError(HttpError(IOError))
[Feed: 2020] Fetching feed (5.58 MB)              [=======----------------------]  25%

I'd certainly like to have some more information so I can figure out how to fix it.

Those are coming from nvd_cve and we should probably add logging to that crate too.