<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../log/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>Crate <aclass="mod"href="#">log</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/log/lib.rs.html#11-1839">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>A lightweight logging facade.</p>
<p>The basic use of the log crate is through the five logging macros: <ahref="./macro.error.html"><code>error!</code></a>,
<ahref="./macro.warn.html"><code>warn!</code></a>, <ahref="./macro.info.html"><code>info!</code></a>, <ahref="./macro.debug.html"><code>debug!</code></a> and <ahref="./macro.trace.html"><code>trace!</code></a>
where <code>error!</code> represents the highest-priority log messages
and <code>trace!</code> the lowest. The log messages are filtered by configuring
the log level to exclude messages with a lower priority.
Each of these macros accept format strings similarly to <ahref="https://doc.rust-lang.org/stable/std/macro.println.html"><code>println!</code></a>.</p>
</div></details><h2id="macros"class="section-header">Macros<ahref="#macros"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="macro"href="macro.debug.html"title="macro log::debug">debug</a></div><divclass="desc docblock-short">Logs a message at the debug level.</div></li><li><divclass="item-name"><aclass="macro"href="macro.error.html"title="macro log::error">error</a></div><divclass="desc docblock-short">Logs a message at the error level.</div></li><li><divclass="item-name"><aclass="macro"href="macro.info.html"title="macro log::info">info</a></div><divclass="desc docblock-short">Logs a message at the info level.</div></li><li><divclass="item-name"><aclass="macro"href="macro.log.html"title="macro log::log">log</a></div><divclass="desc docblock-short">The standard logging macro.</div></li><li><divclass="item-name"><aclass="macro"href="macro.log_enabled.html"title="macro log::log_enabled">log_enabled</a></div><divclass="desc docblock-short">Determines if a message logged at the specified level in that module will
be logged.</div></li><li><divclass="item-name"><aclass="macro"href="macro.trace.html"title="macro log::trace">trace</a></div><divclass="desc docblock-short">Logs a message at the trace level.</div></li><li><divclass="item-name"><aclass="macro"href="macro.warn.html"title="macro log::warn">warn</a></div><divclass="desc docblock-short">Logs a message at the warn level.</div></li></ul><h2id="structs"class="section-header">Structs<ahref="#structs"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="struct"href="struct.Metadata.html"title="struct log::Metadata">Metadata</a></div><divclass="desc docblock-short">Metadata about a log message.</div></li><li><divclass="item-name"><aclass="struct"href="struct.MetadataBuilder.html"title="struct log::MetadataBuilder">MetadataBuilder</a></div><divclass="desc docblock-short">Builder for <ahref="struct.Metadata.html"><code>Metadata</code></a>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.ParseLevelError.html"title="struct log::ParseLevelError">ParseLevelError</a></div><divclass="desc docblock-short">The type returned by <ahref="https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str"><code>from_str</code></a> when the string doesn’t match any of the log levels.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Record.html"title="struct log::Record">Record</a></div><divclass="desc docblock-short">The “payload” of a log message.</div></li><li><divclass="item-name"><aclass="struct"href="struct.RecordBuilder.html"title="struct log::RecordBuilder">RecordBuilder</a></div><divclass="desc docblock-short">Builder for <ahref="struct.Record.html"><code>Record</code></a>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.SetLoggerError.html"title="struct log::SetLoggerError">SetLoggerError</a></div><divclass="desc docblock-short">The type returned by <ahref="fn.set_logger.html"><code>set_logger</code></a> if <ahref="fn.set_logger.html"><code>set_logger</code></a> has already been called.</div></li></ul><h2id="enums"class="section-header">Enums<ahref="#enums"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="enum"href="enum.Level.html"title="enum log::Level">Level</a></div><divclass="desc docblock-short">An enum representing the available verbosity levels of the logger.</div></li><li><divclass="item-name"><aclass="enum"href="enum.LevelFilter.html"title="enum log::LevelFilter">LevelFilter</a></div><divclass="desc docblock-short">An enum representing the available verbosity level filters of the logger.</div></li></ul><h2id="constants"class="section-header">Constants<ahref="#constants"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="constant"href="constant.STATIC_MAX_LEVEL.html"title="constant log::STATIC_MAX_LEVEL">STATIC_MAX_LEVEL</a></div><divclass="desc docblock-short">The statically resolved maximum log level.</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.Log.html"title="trait log::Log">Log</a></div><divclass="desc docblock-short">A trait encapsulating the operations required of a logger.</div></li></ul><h2id="functions"class="section-header">Functions<ahref="#functions"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="fn"href="fn.logger.html"title="fn log::logger">logger</a></div><divclass="desc docblock-short">Returns a reference to the logger.</div></li><li><divclass="item-name"><aclass="fn"href="fn.max_level.html"title="fn log::max_level">max_level</a></div><divclass="desc docblock-short">Returns the current maximum log level.</div></li><li><divclass="item-name"><aclass="fn"href="fn.set_boxed_logger.html"title="fn log::set_boxed_logger">set_boxed_logger</a></div><divclass="desc docblock-short">Sets the global logger to a <code>Box<Log></code>.</div></li><li><div