[#BloombergLP-ball-FileObserver2-setFormat] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/FileObserver2.adoc[FileObserver2]::setFormat :relfileprefix: ../../../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int setFormat(std::string_view const& format); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#