BloombergLP::ball::FileObserver2::setFormat

Set the formatting functor used when writing records to the log file of this file observer to a log file functor created according to the specified, possibly URI-like scheme tagged, format. Return zero if the setup with the specified arguments was successful and also save the format to be later retrievable using getFormat. Otherwise (if no matching scheme could be found or the configuration is invalid) return a non-zero value and do not change the log record formatter used by this object. Note that a default format ("n%d %p:%t %s %f:%l %c %m %un") is in effect until this method or setLogFileFunctor is called. Also, notice that the observer emits newline characters at the beginning and at the end of a log record by default, so the user needs to add them explicitly to (text) format strings to preserve that behavior.

Synopsis

Declared in <ball_fileobserver2.h>

int
setFormat(std::string_view const& format);