bbengfort / fluidfs

A highly consistent distributed filesystem built with FUSE
http://www.fluidfs.com
MIT License
1 stars 0 forks source link

Logging #15

Closed bbengfort closed 7 years ago

bbengfort commented 7 years ago

Create a logging system that has the following log levels:

And add logging system to FluidFS.

Note the logging must be configurable from the YAML file.

bbengfort commented 7 years ago

I do really like Dave Chaney's "Let's talk about logging" post which advocates only two levels: debug and info.

However, as this is a research project, I think having multiple levels of logging is necessary, as well as the ability to specify a log file for processes that run in the background (rather than relying on redirection of stdout).

To get going, here is the mechanism I've implemented:

I played with the idea of passing a "debug" mode that would create another writer to stdout for debugging messages (io.Discard otherwise), but decided against it.

My hope is that wrapping this functionality will also ensure the ability to perform concurrent writes (but I am worried about that).