logging: add a LogConfig class and parsing code
authorAdam Simpkins <simpkins@fb.com>
Tue, 21 Nov 2017 18:44:02 +0000 (10:44 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 21 Nov 2017 18:51:16 +0000 (10:51 -0800)
commit8af0eef96d6b2a2d3ea4e5bd6cf6ccd841fca14b
treec0155fb5758c78fdb0d4f7a461b414bebac1343c
parent65d63573f08eef7b847ebf38ec74d52a61d3b936
logging: add a LogConfig class and parsing code

Summary:
Add a new LogConfig class to represent the current configuration state of the
LoggerDB.  This also includes code to parse config strings in both JSON and a
simpler more human-writable format (intended primarily for use in command line
arguments).

I generally expect the human-writable format to be used mainly to configure log
levels.  It also supports configuring log handler details as well, but the
format for this data is slightly more cumbersome and will probably be harder
for people to easily remember.

The parsing code is intentionally kept as part of the 'init' library rather
than the core 'logging' library so that other libraries that simply wish to log
messages do not need to depend on it.  For instance, this would allow the folly
JSON library to use the logging library without causing a circular dependency.

Reviewed By: bolinfest

Differential Revision: D6200560

fbshipit-source-id: e4e3c7f941808251b6c7bcbbdac0210118675fb0
13 files changed:
CMakeLists.txt
folly/Makefile.am
folly/experimental/logging/LogCategoryConfig.cpp [new file with mode: 0644]
folly/experimental/logging/LogCategoryConfig.h [new file with mode: 0644]
folly/experimental/logging/LogConfig.cpp [new file with mode: 0644]
folly/experimental/logging/LogConfig.h [new file with mode: 0644]
folly/experimental/logging/LogConfigParser.cpp [new file with mode: 0644]
folly/experimental/logging/LogConfigParser.h [new file with mode: 0644]
folly/experimental/logging/LogHandlerConfig.cpp [new file with mode: 0644]
folly/experimental/logging/LogHandlerConfig.h [new file with mode: 0644]
folly/experimental/logging/Makefile.am
folly/experimental/logging/docs/Config.md [new file with mode: 0644]
folly/experimental/logging/test/ConfigParserTest.cpp [new file with mode: 0644]