[#BloombergLP-ball-RecordFormatterRegistryUtil-createRecordFormatter]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/RecordFormatterRegistryUtil.adoc[RecordFormatterRegistryUtil]::createRecordFormatter
:relfileprefix: ../../../
:mrdocs:

Create and load a scheme&hyphen;selected log record formatter into `result`&period;

== Synopsis

Declared in `&lt;ball&lowbar;recordformatterregistryutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
createRecordFormatter(
    xref:BloombergLP/ball/RecordFormatterFunctor/Type.adoc[RecordFormatterFunctor::Type]* result,
    std::string&lowbar;view const& format,
    xref:BloombergLP/ball/RecordFormatterOptions.adoc[RecordFormatterOptions] const& formatOptions);
----

== Description

Load, into the specified `result` a formatter functor that formats as instructed by the specified `format` and `formatOptions`&period; The `format` may start with a URI&hyphen;like scheme (e&period;g&period;, `&quot;qjson&colon;&sol;&sol;&quot;`) that selects both the formatter (class) and the syntax of the format specification that follows the scheme&period; In case `format` does not start with a scheme the &quot;text&colon;&sol;&sol;&quot; scheme is assumed&period; Return 0 if the requested log record formatter was successfully created and loaded into `result`&period; Otherwise, if `result` is empty, load a default&sol;fallback&hyphen;formatter into `result`, with the requested scheme if that exists or with a sensible fallback text log format otherwise&period; For further details on behavior in case of errors see &lcub;Behavior with Invalid Formats&rcub;&period; This method currently supports the &quot;text&quot;, &quot;qjson&quot;, and &quot;json&quot; schemes&period;

== Return Value

0 if the formatter was created successfully, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *result*
| destination for the configured formatter functor
| *format*
| scheme URI and format specification
| *formatOptions*
| supplemental formatter options
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
