logging: add LogFormatter and LogWriter interfaces
Summary: This simplifies the LogHandler interface to a single generic `handleMessage()`, and adds a `StandardLogHandler` implementation that defers to separate `LogFormatter` and `LogWriter` objects. The `LogFormatter` class is responsible for serializing the `LogMessage` object into a string, and `LogWriter` is responsible for then doing something with the serialized string. This will make it possible in the future to have separate `LogWriter` implementations that all share the same log formatting code. For example, this will allow separate `LogWriter` implementations for performing file I/O immediately versus performing I/O asynchronously in a separate thread. Reviewed By: yfeldblum Differential Revision: D5083103 fbshipit-source-id: e3f5ece25e260c825d49a5eb30e942973d6b68bf
Showing
Please register or sign in to comment