• Adam Simpkins's avatar
    logging: add LogFormatter and LogWriter interfaces · 9578ff20
    Adam Simpkins authored
    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
    9578ff20
TestLogHandler.h 1.23 KB