logging: allow partial updates to log handler settings
authorAdam Simpkins <simpkins@fb.com>
Thu, 7 Dec 2017 01:29:32 +0000 (17:29 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 7 Dec 2017 01:41:43 +0000 (17:41 -0800)
commit171c36527455c2709be57f2ccc41218d45689411
treea5d0ec80a70a0feda0ff2295ab63b7c6e13e1206
parent9e1a1ce16ace21118f180ae28ade5ead129093d4
logging: allow partial updates to log handler settings

Summary:
This updates the LogHandlerConfig code to allow changing the settings on an
existing log handler without listing all of its existing options from scratch.

This also changes the syntax of the basic log handler configuration string to
use a colon to separate the log handler name+type from the options list.  In
other words, rather than specifying `default=stream,stream=stderr,async=true`
you now say `default=stream:stream=stderr,async=true`.

The primary motivation for this change is to make it easy for users to switch
the async setting for the default log handler on or off.  Callers can now
specify `default:async=true` to easily enable async mode on the default log
handler without having to completely re-list the full settings for the default
handler.

Reviewed By: yfeldblum

Differential Revision: D6494228

fbshipit-source-id: 52a296f800a5456f0c3aa10546298139c8db52fc
folly/experimental/logging/Init.cpp
folly/experimental/logging/LogConfig.cpp
folly/experimental/logging/LogConfigParser.cpp
folly/experimental/logging/LogHandlerConfig.cpp
folly/experimental/logging/LogHandlerConfig.h
folly/experimental/logging/LoggerDB.cpp
folly/experimental/logging/docs/Config.md
folly/experimental/logging/test/ConfigParserTest.cpp
folly/experimental/logging/test/ConfigUpdateTest.cpp
folly/experimental/logging/test/fatal_test.py