<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../../tracing_subscriber/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../../../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../../../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Module <ahref="../../index.html">tracing_subscriber</a>::<wbr><ahref="../index.html">fmt</a>::<wbr><aclass="mod"href="#">format</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../../../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#1-2179">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Formatters for logging <code>tracing</code> events.</p>
<p>This module provides several formatter implementations, as well as utilities
<p>This module provides a number of formatter implementations:</p>
<ul>
<li>
<p><ahref="struct.Full.html"title="struct tracing_subscriber::fmt::format::Full"><code>Full</code></a>: The default formatter. This emits human-readable,
single-line logs for each event that occurs, with the current span context
displayed before the formatted representation of the event. See
<ahref="struct.Full.html#example-output"title="struct tracing_subscriber::fmt::format::Full">here</a> for sample output.</p>
</li>
<li>
<p><ahref="struct.Compact.html"title="struct tracing_subscriber::fmt::format::Compact"><code>Compact</code></a>: A variant of the default formatter, optimized for
short line lengths. Fields from the current span context are appended to
the fields of the formatted event, and span names are not shown; the
verbosity level is abbreviated to a single character. See
<ahref="struct.Compact.html#example-output"title="struct tracing_subscriber::fmt::format::Compact">here</a> for sample output.</p>
</div></details><h2id="structs"class="section-header">Structs<ahref="#structs"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="struct"href="struct.Compact.html"title="struct tracing_subscriber::fmt::format::Compact">Compact</a></div><divclass="desc docblock-short">Marker for <ahref="struct.Format.html"title="struct tracing_subscriber::fmt::format::Format"><code>Format</code></a> that indicates that the compact log format should be used.</div></li><li><divclass="item-name"><aclass="struct"href="struct.DefaultFields.html"title="struct tracing_subscriber::fmt::format::DefaultFields">DefaultFields</a></div><divclass="desc docblock-short">The default <ahref="../trait.FormatFields.html"title="trait tracing_subscriber::fmt::FormatFields"><code>FormatFields</code></a> implementation.</div></li><li><divclass="item-name"><aclass="struct"href="struct.DefaultVisitor.html"title="struct tracing_subscriber::fmt::format::DefaultVisitor">DefaultVisitor</a></div><divclass="desc docblock-short">The <ahref="../../field/trait.Visit.html"title="trait tracing_subscriber::field::Visit">visitor</a> produced by <ahref="struct.DefaultFields.html"title="struct tracing_subscriber::fmt::format::DefaultFields"><code>DefaultFields</code></a>’s <ahref="../../field/trait.MakeVisitor.html"title="trait tracing_subscriber::field::MakeVisitor"><code>MakeVisitor</code></a> implementation.</div></li><li><divclass="item-name"><aclass="struct"href="struct.FieldFn.html"title="struct tracing_subscriber::fmt::format::FieldFn">FieldFn</a></div><divclass="desc docblock-short">A <ahref="../trait.FormatFields.html"title="trait tracing_subscriber::fmt::FormatFields"><code>FormatFields</code></a> implementation that formats fields by calling a function
or closure.</div></li><li><divclass="item-name"><aclass="struct"href="struct.FieldFnVisitor.html"title="struct tracing_subscriber::fmt::format::FieldFnVisitor">FieldFnVisitor</a></div><divclass="desc docblock-short">The <ahref="../../field/trait.Visit.html"title="trait tracing_subscriber::field::Visit">visitor</a> produced by <ahref="struct.FieldFn.html"title="struct tracing_subscriber::fmt::format::FieldFn"><code>FieldFn</code></a>’s <ahref="../../field/trait.MakeVisitor.html"title="trait tracing_subscriber::field::MakeVisitor"><code>MakeVisitor</code></a> implementation.</div></li><li><divclass="item-name"><aclass="struct"href="struct.FmtSpan.html"title="struct tracing_subscriber::fmt::format::FmtSpan">FmtSpan</a></div><divclass="desc docblock-short">Configures what points in the span lifecycle are logged as events.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Format.html"title="struct tracing_subscriber::fmt::format::Format">Format</a></div><divclass="desc docblock-short">A pre-configured event formatter.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Full.html"title="struct tracing_subscriber::fmt::format::Full">Full</a></div><divclass="desc docblock-short">Marker for <ahref="struct.Format.html"title="struct tracing_subscriber::fmt::format::Format"><code>Format</code></a> that indicates that the default log format should be used.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Pretty.html"title="struct tracing_subscriber::fmt::format::Pretty">Pretty</a></div><divclass="desc docblock-short">An excessively pretty, human-readable event formatter.</div></li><li><divclass="item-name"><aclass="struct"href="struct.PrettyFields.html"title="struct tracing_subscriber::fmt::format::PrettyFields">PrettyFields</a></div><divclass="desc docblock-short">An excessively pretty, human-readable <ahref="../../field/trait.MakeVisitor.html"title="trait tracing_subscriber::field::MakeVisitor"><code>MakeVisitor</code></a> implementation.</div></li><li><divclass="item-name"><aclass="struct"href="struct.PrettyVisitor.html"title="struct tracing_subscriber::fmt::format::PrettyVisitor">PrettyVisitor</a></div><divclass="desc docblock-short">The <ahref="../../field/trait.Visit.html"title="trait tracing_subscriber::field::Visit">visitor</a> produced by <ahref="struct.Pretty.html"title="struct tracing_subscriber::fmt::format::Pretty"><code>Pretty</code></a>’s <ahref="../../field/trait.MakeVisitor.html"title="trait tracing_subscriber::field::MakeVisitor"><code>MakeVisitor</code></a> implementation.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Writer.html"title="struct tracing_subscriber::fmt::format::Writer">Writer</a></div><divclass="desc docblock-short">A writer to which formatted representations of spans and events are written.</div></li></ul><h2id="traits"class="section-header">Traits<ahref="#traits"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="trait"href="trait.FormatEvent.html"title="trait tracing_subscriber::fmt::format::FormatEvent">FormatEvent</a></div><divclass="desc docblock-short">A type that can format a tracing <ahref="../../../tracing_core/event/struct.Event.html"title="struct tracing_core::event::Event"><code>Event</code></a> to a <ahref="struct.Writer.html"title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a>.</div></li><li><divclass="item-name"><aclass="trait"href="trait.FormatFields.html"title="trait tracing_subscriber::fmt::format::FormatFields">FormatFields</a></div><divclass="desc docblock-short">A type that can format a <ahref="../../field/trait.RecordFields.html"title="trait tracing_subscriber::field::RecordFields">set of fields</a> to a <ahref="struct.Writer.html"title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a>.</div></li></ul><h2id="functions"class="section-header">Functions<ahref="#functions"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass
provided function or closure.</div></li><li><divclass="item-name"><aclass="fn"href="fn.format.html"title="fn tracing_subscriber::fmt::format::format">format</a></div><divclass="desc docblock-short">Returns the default configuration for an [event formatter].</div></li></ul></section></div></main></body></html>