Commit Graph

5 Commits

Author SHA1 Message Date
Thomas Orozco
53bf2886cc mononoke: connect stdlog and slog
Summary:
This wires up the stdlog crate with our slog output. The upshot is that we can
now run binaries with `RUST_LOG` set and expect it to work.

This is nice because many crates use stdlog (e.g.  Tokio, Hyper), so this is
convenient to get access to their logging.  For example, if you run with
`RUST_LOG=gotham=info,hyper=debug`, then you get debug logs from Hyper and info
logs from Gotham.

The way this works is by registering a stdlog logger that uses the env_logger's
filter (the one that "invented" `RUST_LOG`) to filter logs, and routes them to
slog if they pass. Note that the slog Logger used there doesn't do any
filtering, since we already do it before sending logs there.

One thing to keep in mind is that we should only register the stdlog global
logger once. I've renamed `get_logger` to `init_logging` to make this clearer.
This behavior is similar to what we do with `init_cachelib`. I've updated
callsites accordingly.

Note that we explicitly tell the stdlog framework to ignore anything that we
won't consider for logging. If you don't set `RUST_LOG`, then the default
logging level is `Error`, which means that anything below error that is sent to
stdlog won't even get to out filtering logic (the stdlog macros for logging
check for the global level before actually logging), so this is cheap unless
you do set `RUST_LOG`.

As part of this, I've also updated all our binaries (and therefore, tests) to
use glog for logging. We had been meaning to do this, and it was convenient to
do it here because the other logger factory we were using didn't make it easy
to get a Drain without putting it a Logger.

Reviewed By: ahornby

Differential Revision: D17314200

fbshipit-source-id: 19b5e8edc3bbe7ba02ccec4f1852dc3587373fff
2019-09-12 04:13:11 -07:00
Thomas Orozco
73f713ca70 mononoke: remove manifold / MySQL flags + safe_writes
Summary: None of these do anything.

Reviewed By: StanislavGlebik

Differential Revision: D16963565

fbshipit-source-id: bb0dd344daf151dd1d5c45392c43b014d2b17a07
2019-09-06 07:17:45 -07:00
Stanislau Hlebik
4265e1bc7a mononoke: remove local_instances option from cmdlib
Summary:
`local_instances` option was used to create fileblobstore or sqlite blobstore.
Now we use mononoke config for this purpose. Since this option is no longer
useful let's delete it

Reviewed By: krallin

Differential Revision: D16120065

fbshipit-source-id: 375a168b27e7f2cf1a6a77f487c5e013f9004546
2019-07-04 08:03:51 -07:00
Jeremy Fitzhardinge
48fc142093 mononoke/configlint: check locality
Reviewed By: StanislavGlebik

Differential Revision: D15167592

fbshipit-source-id: 474e1864468ec05ad0d974160deff29f099063ff
2019-05-21 12:25:45 -07:00
Jeremy Fitzhardinge
dd5de99cc3 mononoke: add configlint to check Mononoke config sanity
Summary:
Currently this checks for:
- all referenced files are present
- they're well-formed toml
- all the required config keys are set, and no unknown ones are set
- blob storage and metadata db are both remote or local
- repo ids are not duplicated

Reviewed By: farnz

Differential Revision: D15068649

fbshipit-source-id: ace0e7bc52bf853ac42384c4346c3b73591312e4
2019-05-21 12:25:30 -07:00