[#BloombergLP-ball-AsyncFileObserver-setLogFormats] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/AsyncFileObserver.adoc[AsyncFileObserver]::setLogFormats :relfileprefix: ../../../ :mrdocs: Set the format specifications for log‐file and `stdout` records. == Synopsis Declared in `<ball_asyncfileobserver.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int setLogFormats( char const* logFileFormat, char const* stdoutFormat); ---- == Description Set the format specifications for log records written to the log file and to `stdout` to the specified `logFileFormat` and `stdoutFormat`, respectively. If the default short output format is currently in effect for logging to `stdout`, this method has the effect of calling `enableStdoutLoggingPrefix` (see that method and `disableStdoutLoggingPrefix`) and setting the format corresponding to enabled `stdout` logging prefix to `stdoutFormat`. See {Log Record Formatting} for details on the syntax of format specifications. Return zero if both formats are valid and have been set. Otherwise, if either format is invalid return a non‐zero value. If one of the formats is invalid it will not be set, but the valid format will. Note that default formats are in effect following construction until a format‐setting method is called ("n%d %p:%t %s %f:%l %c %m %un" for both file and `stdout` logging). DEPRECATED: Prefer `setFileLogFormat` and `setStdoutLogFormat`. == Return Value 0 if both formats are valid, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *logFileFormat* | format specification for log‐file records | *stdoutFormat* | format specification for `stdout` records |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#