lucid-kv / lucid

High performance and distributed KV store w/ REST API. 🦀
https://clintnetwork.gitbook.io/lucid/
MIT License
373 stars 31 forks source link

Moving configuration file parsing before fern #52

Closed imclint21 closed 4 years ago

imclint21 commented 4 years ago

Hey @CephalonRho,

Do you think we can move the configuration parsing part before fern, I mean before Dispatch::new?

Why? To configure logging:

Maybe you can do that with a smarter view, and maybe you have put Dispatch here for a good reason, but I think it's a good thing to do that to improve logging.

Preview:

image

PS: I will surely close #49 because it's outdated

shuni64 commented 4 years ago

I just put it there because the configuration was only relevant when the server gets started, so there wasn't any point in loading it earlier.

If we want to configure logging (other than the log level) we'll have to move things around a bit, but it'll work just fine. Any log messages sent before the logger is created will be discarded, but we might be able to work around that if it ever becomes necessary.

imclint21 commented 4 years ago

I just put it there because the configuration was only relevant when the server gets started, so there wasn't any point in loading it earlier.

Yeah sure!

If we want to configure logging (other than the log level) we'll have to move things around a bit, but it'll work just fine. Any log messages sent before the logger is created will be discarded, but we might be able to work around that if it ever becomes necessary.

I think it's okay, I just continued the PR #49, I let you continue it, I need to sleep :)

imclint21 commented 4 years ago

Well played @CephalonRho!