Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

1
target/doc/log/all.html Normal file
View File

@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">All</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#macros">Crate Items</a></h3><ul class="block"><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>List of all items</h1><rustdoc-toolbar></rustdoc-toolbar></div><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.Metadata.html">Metadata</a></li><li><a href="struct.MetadataBuilder.html">MetadataBuilder</a></li><li><a href="struct.ParseLevelError.html">ParseLevelError</a></li><li><a href="struct.Record.html">Record</a></li><li><a href="struct.RecordBuilder.html">RecordBuilder</a></li><li><a href="struct.SetLoggerError.html">SetLoggerError</a></li></ul><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="enum.Level.html">Level</a></li><li><a href="enum.LevelFilter.html">LevelFilter</a></li></ul><h3 id="traits">Traits</h3><ul class="all-items"><li><a href="trait.Log.html">Log</a></li></ul><h3 id="macros">Macros</h3><ul class="all-items"><li><a href="macro.debug.html">debug</a></li><li><a href="macro.error.html">error</a></li><li><a href="macro.info.html">info</a></li><li><a href="macro.log.html">log</a></li><li><a href="macro.log_enabled.html">log_enabled</a></li><li><a href="macro.trace.html">trace</a></li><li><a href="macro.warn.html">warn</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="fn.logger.html">logger</a></li><li><a href="fn.max_level.html">max_level</a></li><li><a href="fn.set_boxed_logger.html">set_boxed_logger</a></li><li><a href="fn.set_logger.html">set_logger</a></li><li><a href="fn.set_logger_racy.html">set_logger_racy</a></li><li><a href="fn.set_max_level.html">set_max_level</a></li><li><a href="fn.set_max_level_racy.html">set_max_level_racy</a></li></ul><h3 id="constants">Constants</h3><ul class="all-items"><li><a href="constant.STATIC_MAX_LEVEL.html">STATIC_MAX_LEVEL</a></li></ul></section></div></main></body></html>

View File

@@ -0,0 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The statically resolved maximum log level."><title>STATIC_MAX_LEVEL in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">STATIC_MAX_LEVEL</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Constant <span class="constant">STATIC_<wbr>MAX_<wbr>LEVEL</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1611-1624">Source</a> </span></div><pre class="rust item-decl"><code>pub const STATIC_MAX_LEVEL: <a class="enum" href="enum.LevelFilter.html" title="enum log::LevelFilter">LevelFilter</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The statically resolved maximum log level.</p>
<p>See the crate level documentation for information on how to configure this.</p>
<p>This value is checked by the log macros, but not by the <code>Log</code>ger returned by
the <a href="fn.logger.html"><code>logger</code></a> function. Code that manually calls functions on that value
should compare the level against this value.</p>
</div></details></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Returns a reference to the logger."><title>logger in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">logger</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Function <span class="fn">logger</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1581-1596">Source</a> </span></div><pre class="rust item-decl"><code>pub fn logger() -&gt; &amp;'static dyn <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a reference to the logger.</p>
<p>If a logger has not been set, a no-op implementation is returned.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Returns the current maximum log level."><title>max_level in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">max_level</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Function <span class="fn">max_<wbr>level</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1396-1404">Source</a> </span></div><pre class="rust item-decl"><code>pub fn max_level() -&gt; <a class="enum" href="enum.LevelFilter.html" title="enum log::LevelFilter">LevelFilter</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns the current maximum log level.</p>
<p>The <a href="macro.log.html"><code>log!</code></a>, <a href="macro.error.html"><code>error!</code></a>, <a href="macro.warn.html"><code>warn!</code></a>, <a href="macro.info.html"><code>info!</code></a>, <a href="macro.debug.html"><code>debug!</code></a>, and <a href="macro.trace.html"><code>trace!</code></a> macros check
this value and discard any message logged at a higher level. The maximum
log level is set by the <a href="fn.set_max_level.html"><code>set_max_level</code></a> function.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,8 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Sets the global logger to a `Box&#60;Log&#62;`."><title>set_boxed_logger in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">set_boxed_logger</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">set_<wbr>boxed_<wbr>logger</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#errors" title="Errors">Errors</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Function <span class="fn">set_<wbr>boxed_<wbr>logger</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1420-1422">Source</a> </span></div><pre class="rust item-decl"><code>pub fn set_boxed_logger(logger: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SetLoggerError.html" title="struct log::SetLoggerError">SetLoggerError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Sets the global logger to a <code>Box&lt;Log&gt;</code>.</p>
<p>This is a simple convenience wrapper over <code>set_logger</code>, which takes a
<code>Box&lt;Log&gt;</code> rather than a <code>&amp;'static Log</code>. See the documentation for
<a href="fn.set_logger.html"><code>set_logger</code></a> for more details.</p>
<p>Requires the <code>std</code> feature.</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>An error is returned if a logger has already been set.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,39 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Sets the global logger to a `&#38;&#39;static Log`."><title>set_logger in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">set_logger</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">set_<wbr>logger</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#availability" title="Availability">Availability</a></li><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Function <span class="fn">set_<wbr>logger</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1478-1480">Source</a> </span></div><pre class="rust item-decl"><code>pub fn set_logger(logger: &amp;'static dyn <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SetLoggerError.html" title="struct log::SetLoggerError">SetLoggerError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Sets the global logger to a <code>&amp;'static Log</code>.</p>
<p>This function may only be called once in the lifetime of a program. Any log
events that occur before the call to <code>set_logger</code> completes will be ignored.</p>
<p>This function does not typically need to be called manually. Logger
implementations should provide an initialization method that installs the
logger internally.</p>
<h2 id="availability"><a class="doc-anchor" href="#availability">§</a>Availability</h2>
<p>This method is available even when the <code>std</code> feature is disabled. However,
it is currently unavailable on <code>thumbv6</code> targets, which lack support for
some atomic operations which are used by this function. Even on those
targets, <a href="fn.set_logger_racy.html"><code>set_logger_racy</code></a> will be available.</p>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>An error is returned if a logger has already been set.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{error, info, warn, Record, Level, Metadata, LevelFilter};
<span class="kw">static </span>MY_LOGGER: MyLogger = MyLogger;
<span class="kw">struct </span>MyLogger;
<span class="kw">impl </span>log::Log <span class="kw">for </span>MyLogger {
<span class="kw">fn </span>enabled(<span class="kw-2">&amp;</span><span class="self">self</span>, metadata: <span class="kw-2">&amp;</span>Metadata) -&gt; bool {
metadata.level() &lt;= Level::Info
}
<span class="kw">fn </span>log(<span class="kw-2">&amp;</span><span class="self">self</span>, record: <span class="kw-2">&amp;</span>Record) {
<span class="kw">if </span><span class="self">self</span>.enabled(record.metadata()) {
<span class="macro">println!</span>(<span class="string">"{} - {}"</span>, record.level(), record.args());
}
}
<span class="kw">fn </span>flush(<span class="kw-2">&amp;</span><span class="self">self</span>) {}
}
log::set_logger(<span class="kw-2">&amp;</span>MY_LOGGER).unwrap();
log::set_max_level(LevelFilter::Info);
<span class="macro">info!</span>(<span class="string">"hello log"</span>);
<span class="macro">warn!</span>(<span class="string">"warning"</span>);
<span class="macro">error!</span>(<span class="string">"oops"</span>);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A thread-unsafe version of `set_logger`."><title>set_logger_racy in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">set_logger_racy</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">set_<wbr>logger_<wbr>racy</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Function <span class="fn">set_<wbr>logger_<wbr>racy</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1529-1542">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn set_logger_racy(
logger: &amp;'static dyn <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, <a class="struct" href="struct.SetLoggerError.html" title="struct log::SetLoggerError">SetLoggerError</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A thread-unsafe version of <a href="fn.set_logger.html"><code>set_logger</code></a>.</p>
<p>This function is available on all platforms, even those that do not have
support for atomics that is needed by <a href="fn.set_logger.html"><code>set_logger</code></a>.</p>
<p>In almost all cases, <a href="fn.set_logger.html"><code>set_logger</code></a> should be preferred.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>This function is only safe to call when it cannot race with any other
calls to <code>set_logger</code> or <code>set_logger_racy</code>.</p>
<p>This can be upheld by (for example) making sure that <strong>there are no other
threads</strong>, and (on embedded) that <strong>interrupts are disabled</strong>.</p>
<p>It is safe to use other logging functions while this function runs
(including all logging macros).</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Sets the global maximum log level."><title>set_max_level in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">set_max_level</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Function <span class="fn">set_<wbr>max_<wbr>level</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1351-1353">Source</a> </span></div><pre class="rust item-decl"><code>pub fn set_max_level(level: <a class="enum" href="enum.LevelFilter.html" title="enum log::LevelFilter">LevelFilter</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Sets the global maximum log level.</p>
<p>Generally, this should only be called by the active logging implementation.</p>
<p>Note that <code>Trace</code> is the maximum level, because it provides the maximum amount of detail in the emitted logs.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A thread-unsafe version of `set_max_level`."><title>set_max_level_racy in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">set_max_level_racy</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">set_<wbr>max_<wbr>level_<wbr>racy</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Function <span class="fn">set_<wbr>max_<wbr>level_<wbr>racy</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1375-1380">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn set_max_level_racy(level: <a class="enum" href="enum.LevelFilter.html" title="enum log::LevelFilter">LevelFilter</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A thread-unsafe version of <a href="fn.set_max_level.html"><code>set_max_level</code></a>.</p>
<p>This function is available on all platforms, even those that do not have
support for atomics that is needed by <a href="fn.set_max_level.html"><code>set_max_level</code></a>.</p>
<p>In almost all cases, <a href="fn.set_max_level.html"><code>set_max_level</code></a> should be preferred.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<p>This function is only safe to call when it cannot race with any other
calls to <code>set_max_level</code> or <code>set_max_level_racy</code>.</p>
<p>This can be upheld by (for example) making sure that <strong>there are no other
threads</strong>, and (on embedded) that <strong>interrupts are disabled</strong>.</p>
<p>It is safe to use all other logging functions while this function runs
(including all logging macros).</p>
</div></details></section></div></main></body></html>

230
target/doc/log/index.html Normal file
View File

@@ -0,0 +1,230 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A lightweight logging facade."><title>log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Crate log</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#usage" title="Usage">Usage</a><ul><li><a href="#in-libraries" title="In libraries">In libraries</a></li><li><a href="#in-executables" title="In executables">In executables</a></li><li><a href="#structured-logging" title="Structured logging">Structured logging</a></li></ul></li><li><a href="#available-logging-implementations" title="Available logging implementations">Available logging implementations</a></li><li><a href="#implementing-a-logger" title="Implementing a Logger">Implementing a Logger</a></li><li><a href="#use-with-std" title="Use with `std`">Use with <code>std</code></a></li><li><a href="#compile-time-filters" title="Compile time filters">Compile time filters</a></li><li><a href="#crate-feature-flags" title="Crate Feature Flags">Crate Feature Flags</a></li><li><a href="#version-compatibility" title="Version compatibility">Version compatibility</a></li></ul><h3><a href="#macros">Crate Items</a></h3><ul class="block"><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>log</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#11-2010">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A lightweight logging facade.</p>
<p>The <code>log</code> crate provides a single logging API that abstracts over the
actual logging implementation. Libraries can use the logging API provided
by this crate, and the consumer of those libraries can choose the logging
implementation that is most suitable for its use case.</p>
<p>If no logging implementation is selected, the facade falls back to a “noop”
implementation that ignores all log messages. The overhead in this case
is very small - just an integer load, comparison and jump.</p>
<p>A log request consists of a <em>target</em>, a <em>level</em>, and a <em>body</em>. A target is a
string which defaults to the module path of the location of the log request,
though that default may be overridden. Logger implementations typically use
the target to filter requests based on some user configuration.</p>
<h2 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h2>
<p>The basic use of the log crate is through the five logging macros: <a href="./macro.error.html"><code>error!</code></a>,
<a href="./macro.warn.html"><code>warn!</code></a>, <a href="./macro.info.html"><code>info!</code></a>, <a href="./macro.debug.html"><code>debug!</code></a> and <a href="./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 <a href="https://doc.rust-lang.org/stable/std/macro.println.html"><code>println!</code></a>.</p>
<p>Avoid writing expressions with side-effects in log statements. They may not be evaluated.</p>
<h3 id="in-libraries"><a class="doc-anchor" href="#in-libraries">§</a>In libraries</h3>
<p>Libraries should link only to the <code>log</code> crate, and use the provided
macros to log whatever information will be useful to downstream consumers.</p>
<h4 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{info, warn};
<span class="kw">pub fn </span>shave_the_yak(yak: <span class="kw-2">&amp;mut </span>Yak) {
<span class="macro">info!</span>(target: <span class="string">"yak_events"</span>, <span class="string">"Commencing yak shaving for {yak:?}"</span>);
<span class="kw">loop </span>{
<span class="kw">match </span>find_a_razor() {
<span class="prelude-val">Ok</span>(razor) =&gt; {
<span class="macro">info!</span>(<span class="string">"Razor located: {razor}"</span>);
yak.shave(razor);
<span class="kw">break</span>;
}
<span class="prelude-val">Err</span>(err) =&gt; {
<span class="macro">warn!</span>(<span class="string">"Unable to locate a razor: {err}, retrying"</span>);
}
}
}
}</code></pre></div><h3 id="in-executables"><a class="doc-anchor" href="#in-executables">§</a>In executables</h3>
<p>Executables should choose a logging implementation and initialize it early in the
runtime of the program. Logging implementations will typically include a
function to do this. Any log messages generated before
the implementation is initialized will be ignored.</p>
<p>The executable itself may use the <code>log</code> crate to log as well.</p>
<h4 id="warning"><a class="doc-anchor" href="#warning">§</a>Warning</h4>
<p>The logging system may only be initialized once.</p>
<h3 id="structured-logging"><a class="doc-anchor" href="#structured-logging">§</a>Structured logging</h3>
<p>If you enable the <code>kv</code> feature you can associate structured values
with your log records. If we take the example from before, we can include
some additional context besides whats in the formatted message:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{info, warn};
<span class="kw">pub fn </span>shave_the_yak(yak: <span class="kw-2">&amp;mut </span>Yak) {
<span class="macro">info!</span>(target: <span class="string">"yak_events"</span>, yak:serde; <span class="string">"Commencing yak shaving"</span>);
<span class="kw">loop </span>{
<span class="kw">match </span>find_a_razor() {
<span class="prelude-val">Ok</span>(razor) =&gt; {
<span class="macro">info!</span>(razor; <span class="string">"Razor located"</span>);
yak.shave(razor);
<span class="kw">break</span>;
}
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="macro">warn!</span>(e:err; <span class="string">"Unable to locate a razor, retrying"</span>);
}
}
}
}</code></pre></div>
<p>See the [<code>kv</code>] module documentation for more details.</p>
<h2 id="available-logging-implementations"><a class="doc-anchor" href="#available-logging-implementations">§</a>Available logging implementations</h2>
<p>In order to produce log output executables have to use
a logger implementation compatible with the facade.
There are many available implementations to choose from,
here are some of the most popular ones:</p>
<ul>
<li>Simple minimal loggers:
<ul>
<li><a href="https://docs.rs/env_logger/*/env_logger/">env_logger</a></li>
<li><a href="https://docs.rs/colog/*/colog/">colog</a></li>
<li><a href="https://github.com/borntyping/rust-simple_logger">simple_logger</a></li>
<li><a href="https://github.com/drakulix/simplelog.rs">simplelog</a></li>
<li><a href="https://docs.rs/pretty_env_logger/*/pretty_env_logger/">pretty_env_logger</a></li>
<li><a href="https://docs.rs/stderrlog/*/stderrlog/">stderrlog</a></li>
<li><a href="https://docs.rs/flexi_logger/*/flexi_logger/">flexi_logger</a></li>
<li><a href="https://docs.rs/call_logger/*/call_logger/">call_logger</a></li>
<li><a href="https://docs.rs/std-logger/*/std_logger/">std-logger</a></li>
<li><a href="https://docs.rs/structured-logger/latest/structured_logger/">structured-logger</a></li>
<li><a href="https://docs.rs/clang_log/latest/clang_log">clang_log</a></li>
<li><a href="https://docs.rs/ftail/latest/ftail">ftail</a></li>
</ul>
</li>
<li>Complex configurable frameworks:
<ul>
<li><a href="https://docs.rs/log4rs/*/log4rs/">log4rs</a></li>
<li><a href="https://docs.rs/logforth/*/logforth/">logforth</a></li>
<li><a href="https://docs.rs/fern/*/fern/">fern</a></li>
<li><a href="https://docs.rs/spdlog-rs/*/spdlog/">spdlog-rs</a></li>
</ul>
</li>
<li>Adaptors for other facilities:
<ul>
<li><a href="https://docs.rs/syslog/*/syslog/">syslog</a></li>
<li><a href="https://docs.rs/slog-stdlog/*/slog_stdlog/">slog-stdlog</a></li>
<li><a href="https://docs.rs/systemd-journal-logger/*/systemd_journal_logger/">systemd-journal-logger</a></li>
<li><a href="https://docs.rs/android_log/*/android_log/">android_log</a></li>
<li><a href="https://docs.rs/win_dbg_logger/*/win_dbg_logger/">win_dbg_logger</a></li>
<li><a href="https://docs.rs/db_logger/*/db_logger/">db_logger</a></li>
<li><a href="https://docs.rs/log-to-defmt/*/log_to_defmt/">log-to-defmt</a></li>
<li><a href="https://docs.rs/logcontrol-log/*/logcontrol_log/">logcontrol-log</a></li>
</ul>
</li>
<li>For WebAssembly binaries:
<ul>
<li><a href="https://docs.rs/console_log/*/console_log/">console_log</a></li>
</ul>
</li>
<li>For dynamic libraries:
<ul>
<li>You may need to construct an FFI-safe wrapper over <code>log</code> to initialize in your libraries</li>
</ul>
</li>
<li>Utilities:
<ul>
<li><a href="https://docs.rs/log_err/*/log_err/">log_err</a></li>
<li><a href="https://docs.rs/log-reload/*/log_reload/">log-reload</a></li>
<li><a href="https://docs.rs/alterable_logger/*/alterable_logger">alterable_logger</a></li>
</ul>
</li>
</ul>
<h2 id="implementing-a-logger"><a class="doc-anchor" href="#implementing-a-logger">§</a>Implementing a Logger</h2>
<p>Loggers implement the <a href="trait.Log.html"><code>Log</code></a> trait. Heres a very basic example that simply
logs all messages at the <a href="enum.Level.html"><code>Error</code></a>, <a href="enum.Level.html"><code>Warn</code></a> or
<a href="enum.Level.html"><code>Info</code></a> levels to stdout:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{Record, Level, Metadata};
<span class="kw">struct </span>SimpleLogger;
<span class="kw">impl </span>log::Log <span class="kw">for </span>SimpleLogger {
<span class="kw">fn </span>enabled(<span class="kw-2">&amp;</span><span class="self">self</span>, metadata: <span class="kw-2">&amp;</span>Metadata) -&gt; bool {
metadata.level() &lt;= Level::Info
}
<span class="kw">fn </span>log(<span class="kw-2">&amp;</span><span class="self">self</span>, record: <span class="kw-2">&amp;</span>Record) {
<span class="kw">if </span><span class="self">self</span>.enabled(record.metadata()) {
<span class="macro">println!</span>(<span class="string">"{} - {}"</span>, record.level(), record.args());
}
}
<span class="kw">fn </span>flush(<span class="kw-2">&amp;</span><span class="self">self</span>) {}
}
</code></pre></div>
<p>Loggers are installed by calling the <a href="fn.set_logger.html"><code>set_logger</code></a> function. The maximum
log level also needs to be adjusted via the <a href="fn.set_max_level.html"><code>set_max_level</code></a> function. The
logging facade uses this as an optimization to improve performance of log
messages at levels that are disabled. Its important to set it, as it
defaults to <a href="enum.LevelFilter.html"><code>Off</code></a>, so no log messages will ever be captured!
In the case of our example logger, well want to set the maximum log level
to <a href="enum.LevelFilter.html"><code>Info</code></a>, since we ignore any <a href="enum.Level.html"><code>Debug</code></a> or
<a href="enum.Level.html"><code>Trace</code></a> level log messages. A logging implementation should
provide a function that wraps a call to <a href="fn.set_logger.html"><code>set_logger</code></a> and
<a href="fn.set_max_level.html"><code>set_max_level</code></a>, handling initialization of the logger:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{SetLoggerError, LevelFilter};
<span class="kw">static </span>LOGGER: SimpleLogger = SimpleLogger;
<span class="kw">pub fn </span>init() -&gt; <span class="prelude-ty">Result</span>&lt;(), SetLoggerError&gt; {
log::set_logger(<span class="kw-2">&amp;</span>LOGGER)
.map(|()| log::set_max_level(LevelFilter::Info))
}</code></pre></div>
<p>Implementations that adjust their configurations at runtime should take care
to adjust the maximum log level as well.</p>
<h2 id="use-with-std"><a class="doc-anchor" href="#use-with-std">§</a>Use with <code>std</code></h2>
<p><code>set_logger</code> requires you to provide a <code>&amp;'static Log</code>, which can be hard to
obtain if your logger depends on some runtime configuration. The
<code>set_boxed_logger</code> function is available with the <code>std</code> Cargo feature. It is
identical to <code>set_logger</code> except that it takes a <code>Box&lt;Log&gt;</code> rather than a
<code>&amp;'static Log</code>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>init() -&gt; <span class="prelude-ty">Result</span>&lt;(), SetLoggerError&gt; {
log::set_boxed_logger(Box::new(SimpleLogger))
.map(|()| log::set_max_level(LevelFilter::Info))
}</code></pre></div><h2 id="compile-time-filters"><a class="doc-anchor" href="#compile-time-filters">§</a>Compile time filters</h2>
<p>Log levels can be statically disabled at compile time by enabling one of these Cargo features:</p>
<ul>
<li><code>max_level_off</code></li>
<li><code>max_level_error</code></li>
<li><code>max_level_warn</code></li>
<li><code>max_level_info</code></li>
<li><code>max_level_debug</code></li>
<li><code>max_level_trace</code></li>
</ul>
<p>Log invocations at disabled levels will be skipped and will not even be present in the
resulting binary. These features control the value of the <code>STATIC_MAX_LEVEL</code> constant. The
logging macros check this value before logging a message. By default, no levels are disabled.</p>
<p>It is possible to override this level for release builds only with the following features:</p>
<ul>
<li><code>release_max_level_off</code></li>
<li><code>release_max_level_error</code></li>
<li><code>release_max_level_warn</code></li>
<li><code>release_max_level_info</code></li>
<li><code>release_max_level_debug</code></li>
<li><code>release_max_level_trace</code></li>
</ul>
<p>Libraries should avoid using the max level features because theyre global and cant be changed
once theyre set.</p>
<p>For example, a crate can disable trace level logs in debug builds and trace, debug, and info
level logs in release builds with the following configuration:</p>
<div class="example-wrap"><pre class="language-toml"><code>[dependencies]
log = { version = &quot;0.4&quot;, features = [&quot;max_level_debug&quot;, &quot;release_max_level_warn&quot;] }</code></pre></div><h2 id="crate-feature-flags"><a class="doc-anchor" href="#crate-feature-flags">§</a>Crate Feature Flags</h2>
<p>The following crate feature flags are available in addition to the filters. They are
configured in your <code>Cargo.toml</code>.</p>
<ul>
<li><code>std</code> allows use of <code>std</code> crate instead of the default <code>core</code>. Enables using <code>std::error</code> and
<code>set_boxed_logger</code> functionality.</li>
<li><code>serde</code> enables support for serialization and deserialization of <code>Level</code> and <code>LevelFilter</code>.</li>
</ul>
<div class="example-wrap"><pre class="language-toml"><code>[dependencies]
log = { version = &quot;0.4&quot;, features = [&quot;std&quot;, &quot;serde&quot;] }</code></pre></div><h2 id="version-compatibility"><a class="doc-anchor" href="#version-compatibility">§</a>Version compatibility</h2>
<p>The 0.3 and 0.4 versions of the <code>log</code> crate are almost entirely compatible. Log messages
made using <code>log</code> 0.3 will forward transparently to a logger implementation using <code>log</code> 0.4. Log
messages made using <code>log</code> 0.4 will forward to a logger implementation using <code>log</code> 0.3, but the
module path and file name information associated with the message will unfortunately be lost.</p>
</div></details><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><dl class="item-table"><dt><a class="macro" href="macro.debug.html" title="macro log::debug">debug</a></dt><dd>Logs a message at the debug level.</dd><dt><a class="macro" href="macro.error.html" title="macro log::error">error</a></dt><dd>Logs a message at the error level.</dd><dt><a class="macro" href="macro.info.html" title="macro log::info">info</a></dt><dd>Logs a message at the info level.</dd><dt><a class="macro" href="macro.log.html" title="macro log::log">log</a></dt><dd>The standard logging macro.</dd><dt><a class="macro" href="macro.log_enabled.html" title="macro log::log_enabled">log_<wbr>enabled</a></dt><dd>Determines if a message logged at the specified level in that module will
be logged.</dd><dt><a class="macro" href="macro.trace.html" title="macro log::trace">trace</a></dt><dd>Logs a message at the trace level.</dd><dt><a class="macro" href="macro.warn.html" title="macro log::warn">warn</a></dt><dd>Logs a message at the warn level.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Metadata.html" title="struct log::Metadata">Metadata</a></dt><dd>Metadata about a log message.</dd><dt><a class="struct" href="struct.MetadataBuilder.html" title="struct log::MetadataBuilder">Metadata<wbr>Builder</a></dt><dd>Builder for <a href="struct.Metadata.html"><code>Metadata</code></a>.</dd><dt><a class="struct" href="struct.ParseLevelError.html" title="struct log::ParseLevelError">Parse<wbr>Level<wbr>Error</a></dt><dd>The type returned by <a href="https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str"><code>from_str</code></a> when the string doesnt match any of the log levels.</dd><dt><a class="struct" href="struct.Record.html" title="struct log::Record">Record</a></dt><dd>The “payload” of a log message.</dd><dt><a class="struct" href="struct.RecordBuilder.html" title="struct log::RecordBuilder">Record<wbr>Builder</a></dt><dd>Builder for <a href="struct.Record.html"><code>Record</code></a>.</dd><dt><a class="struct" href="struct.SetLoggerError.html" title="struct log::SetLoggerError">SetLogger<wbr>Error</a></dt><dd>The type returned by <a href="fn.set_logger.html"><code>set_logger</code></a> if <a href="fn.set_logger.html"><code>set_logger</code></a> has already been called.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Level.html" title="enum log::Level">Level</a></dt><dd>An enum representing the available verbosity levels of the logger.</dd><dt><a class="enum" href="enum.LevelFilter.html" title="enum log::LevelFilter">Level<wbr>Filter</a></dt><dd>An enum representing the available verbosity level filters of the logger.</dd></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.STATIC_MAX_LEVEL.html" title="constant log::STATIC_MAX_LEVEL">STATIC_<wbr>MAX_<wbr>LEVEL</a></dt><dd>The statically resolved maximum log level.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Log.html" title="trait log::Log">Log</a></dt><dd>A trait encapsulating the operations required of a logger.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.logger.html" title="fn log::logger">logger</a></dt><dd>Returns a reference to the logger.</dd><dt><a class="fn" href="fn.max_level.html" title="fn log::max_level">max_<wbr>level</a></dt><dd>Returns the current maximum log level.</dd><dt><a class="fn" href="fn.set_boxed_logger.html" title="fn log::set_boxed_logger">set_<wbr>boxed_<wbr>logger</a></dt><dd>Sets the global logger to a <code>Box&lt;Log&gt;</code>.</dd><dt><a class="fn" href="fn.set_logger.html" title="fn log::set_logger">set_<wbr>logger</a></dt><dd>Sets the global logger to a <code>&amp;'static Log</code>.</dd><dt><a class="fn" href="fn.set_logger_racy.html" title="fn log::set_logger_racy">set_<wbr>logger_<wbr>racy</a><sup title="unsafe function"></sup></dt><dd>A thread-unsafe version of <a href="fn.set_logger.html"><code>set_logger</code></a>.</dd><dt><a class="fn" href="fn.set_max_level.html" title="fn log::set_max_level">set_<wbr>max_<wbr>level</a></dt><dd>Sets the global maximum log level.</dd><dt><a class="fn" href="fn.set_max_level_racy.html" title="fn log::set_max_level_racy">set_<wbr>max_<wbr>level_<wbr>racy</a><sup title="unsafe function"></sup></dt><dd>A thread-unsafe version of <a href="fn.set_max_level.html"><code>set_max_level</code></a>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.debug.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.debug.html">macro.debug.html</a>...</p>
<script>location.replace("macro.debug.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Logs a message at the debug level."><title>debug in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">debug</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">debug</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Macro <span class="macro">debug</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/macros.rs.html#292-313">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! debug {
(logger: $logger:expr, target: $target:expr, $($arg:tt)+) =&gt; { ... };
(logger: $logger:expr, $($arg:tt)+) =&gt; { ... };
(target: $target:expr, $($arg:tt)+) =&gt; { ... };
($($arg:tt)+) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Logs a message at the debug level.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::debug;
<span class="kw">let </span>pos = Position { x: <span class="number">3.234</span>, y: -<span class="number">1.223 </span>};
<span class="macro">debug!</span>(<span class="string">"New position: x: {}, y: {}"</span>, pos.x, pos.y);
<span class="macro">debug!</span>(target: <span class="string">"app_events"</span>, <span class="string">"New position: x: {}, y: {}"</span>, pos.x, pos.y);
<span class="macro">debug!</span>(logger: my_logger, <span class="string">"New position: x: {}, y: {}"</span>, pos.x, pos.y);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.error.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.error.html">macro.error.html</a>...</p>
<script>location.replace("macro.error.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Logs a message at the error level."><title>error in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">error</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">error</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Macro <span class="macro">error</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/macros.rs.html#165-186">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! error {
(logger: $logger:expr, target: $target:expr, $($arg:tt)+) =&gt; { ... };
(logger: $logger:expr, $($arg:tt)+) =&gt; { ... };
(target: $target:expr, $($arg:tt)+) =&gt; { ... };
($($arg:tt)+) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Logs a message at the error level.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::error;
<span class="kw">let </span>(err_info, port) = (<span class="string">"No connection"</span>, <span class="number">22</span>);
<span class="macro">error!</span>(<span class="string">"Error: {err_info} on port {port}"</span>);
<span class="macro">error!</span>(target: <span class="string">"app_events"</span>, <span class="string">"App Error: {err_info}, Port: {port}"</span>);
<span class="macro">error!</span>(logger: my_logger, <span class="string">"App Error: {err_info}, Port: {port}"</span>);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.info.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.info.html">macro.info.html</a>...</p>
<script>location.replace("macro.info.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,22 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Logs a message at the info level."><title>info in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">info</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">info</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Macro <span class="macro">info</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/macros.rs.html#252-273">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! info {
(logger: $logger:expr, target: $target:expr, $($arg:tt)+) =&gt; { ... };
(logger: $logger:expr, $($arg:tt)+) =&gt; { ... };
(target: $target:expr, $($arg:tt)+) =&gt; { ... };
($($arg:tt)+) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Logs a message at the info level.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::info;
<span class="kw">let </span>conn_info = Connection { port: <span class="number">40</span>, speed: <span class="number">3.20 </span>};
<span class="macro">info!</span>(<span class="string">"Connected to port {} at {} Mb/s"</span>, conn_info.port, conn_info.speed);
<span class="macro">info!</span>(
target: <span class="string">"connection_events"</span>,
<span class="string">"Successful connection, port: {}, speed: {}"</span>,
conn_info.port, conn_info.speed
);
<span class="macro">info!</span>(
logger: my_logger,
<span class="string">"Successful connection, port: {}, speed: {}"</span>,
conn_info.port, conn_info.speed
);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.log.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.log.html">macro.log.html</a>...</p>
<script>location.replace("macro.log.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,49 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The standard logging macro."><title>log in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">log</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Macro <span class="macro">log</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/macros.rs.html#75-115">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! log {
(logger: $logger:expr, target: $target:expr, $lvl:expr, $($arg:tt)+) =&gt; { ... };
(logger: $logger:expr, $lvl:expr, $($arg:tt)+) =&gt; { ... };
(target: $target:expr, $lvl:expr, $($arg:tt)+) =&gt; { ... };
($lvl:expr, $($arg:tt)+) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The standard logging macro.</p>
<p>This macro will generically log with the specified <code>Level</code> and <code>format!</code>
based argument list.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{log, Level};
<span class="kw">let </span>data = (<span class="number">42</span>, <span class="string">"Forty-two"</span>);
<span class="kw">let </span>private_data = <span class="string">"private"</span>;
<span class="macro">log!</span>(Level::Error, <span class="string">"Received errors: {}, {}"</span>, data.<span class="number">0</span>, data.<span class="number">1</span>);</code></pre></div>
<p>Optionally, you can specify a <code>target</code> argument to attach a specific target
to the log record. By default, the target is the module path of the caller.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{log, Level};
<span class="kw">let </span>data = (<span class="number">42</span>, <span class="string">"Forty-two"</span>);
<span class="kw">let </span>private_data = <span class="string">"private"</span>;
<span class="macro">log!</span>(
target: <span class="string">"app_events"</span>,
Level::Error,
<span class="string">"Received errors: {}, {}"</span>,
data.<span class="number">0</span>, data.<span class="number">1
</span>);</code></pre></div>
<p>And optionally, you can specify a <code>logger</code> argument to use a specific logger
instead of the default global logger.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{log, Level, Log};
<span class="kw">let </span>data = (<span class="number">42</span>, <span class="string">"Forty-two"</span>);
<span class="kw">let </span>private_data = <span class="string">"private"</span>;
<span class="kw">let </span>my_logger = MyLogger {};
<span class="macro">log!</span>(
logger: my_logger,
Level::Error,
<span class="string">"Received errors: {}, {}"</span>,
data.<span class="number">0</span>, data.<span class="number">1
</span>);</code></pre></div>
<p>The <code>logger</code> argument accepts a value that implements the <code>Log</code> trait. The value
will be borrowed within the macro.</p>
<p>Note that the global level set via Cargo features, or through <code>set_max_level</code> will
still apply, even when a custom logger is supplied with the <code>logger</code> argument.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.log_enabled.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.log_enabled.html">macro.log_enabled.html</a>...</p>
<script>location.replace("macro.log_enabled.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,28 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Determines if a message logged at the specified level in that module will be logged."><title>log_enabled in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">log_enabled</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">log_<wbr>enabled</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Macro <span class="macro">log_<wbr>enabled</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/macros.rs.html#391-411">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! log_enabled {
(logger: $logger:expr, target: $target:expr, $lvl:expr) =&gt; { ... };
(logger: $logger:expr, $lvl:expr) =&gt; { ... };
(target: $target:expr, $lvl:expr) =&gt; { ... };
($lvl:expr) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Determines if a message logged at the specified level in that module will
be logged.</p>
<p>This can be used to avoid expensive computation of log message arguments if
the message would be ignored anyway.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::{debug, log_enabled, Level};
<span class="kw">if </span><span class="macro">log_enabled!</span>(Level::Debug) {
<span class="kw">let </span>data = expensive_call();
<span class="macro">debug!</span>(<span class="string">"expensive debug data: {} {}"</span>, data.x, data.y);
}
<span class="kw">if </span><span class="macro">log_enabled!</span>(target: <span class="string">"Global"</span>, Level::Debug) {
<span class="kw">let </span>data = expensive_call();
<span class="macro">debug!</span>(target: <span class="string">"Global"</span>, <span class="string">"expensive debug data: {} {}"</span>, data.x, data.y);
}
<span class="kw">if </span><span class="macro">log_enabled!</span>(logger: my_logger, Level::Debug) {
<span class="kw">let </span>data = expensive_call();
<span class="macro">debug!</span>(target: <span class="string">"Global"</span>, <span class="string">"expensive debug data: {} {}"</span>, data.x, data.y);
}</code></pre></div>
<p>This macro accepts the same <code>target</code> and <code>logger</code> arguments as <a href="macro.log.html" title="macro log::log"><code>log</code></a>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.trace.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.trace.html">macro.trace.html</a>...</p>
<script>location.replace("macro.trace.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Logs a message at the trace level."><title>trace in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">trace</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">trace</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Macro <span class="macro">trace</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/macros.rs.html#336-357">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! trace {
(logger: $logger:expr, target: $target:expr, $($arg:tt)+) =&gt; { ... };
(logger: $logger:expr, $($arg:tt)+) =&gt; { ... };
(target: $target:expr, $($arg:tt)+) =&gt; { ... };
($($arg:tt)+) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Logs a message at the trace level.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::trace;
<span class="kw">let </span>pos = Position { x: <span class="number">3.234</span>, y: -<span class="number">1.223 </span>};
<span class="macro">trace!</span>(<span class="string">"Position is: x: {}, y: {}"</span>, pos.x, pos.y);
<span class="macro">trace!</span>(target: <span class="string">"app_events"</span>, <span class="string">"x is {} and y is {}"</span>,
<span class="kw">if </span>pos.x &gt;= <span class="number">0.0 </span>{ <span class="string">"positive" </span>} <span class="kw">else </span>{ <span class="string">"negative" </span>},
<span class="kw">if </span>pos.y &gt;= <span class="number">0.0 </span>{ <span class="string">"positive" </span>} <span class="kw">else </span>{ <span class="string">"negative" </span>});
<span class="macro">trace!</span>(logger: my_logger, <span class="string">"x is {} and y is {}"</span>,
<span class="kw">if </span>pos.x &gt;= <span class="number">0.0 </span>{ <span class="string">"positive" </span>} <span class="kw">else </span>{ <span class="string">"negative" </span>},
<span class="kw">if </span>pos.y &gt;= <span class="number">0.0 </span>{ <span class="string">"positive" </span>} <span class="kw">else </span>{ <span class="string">"negative" </span>});</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.warn.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.warn.html">macro.warn.html</a>...</p>
<script>location.replace("macro.warn.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Logs a message at the warn level."><title>warn in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">warn</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">warn</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Macro <span class="macro">warn</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/macros.rs.html#204-225">Source</a> </span></div><pre class="rust item-decl"><code>macro_rules! warn {
(logger: $logger:expr, target: $target:expr, $($arg:tt)+) =&gt; { ... };
(logger: $logger:expr, $($arg:tt)+) =&gt; { ... };
(target: $target:expr, $($arg:tt)+) =&gt; { ... };
($($arg:tt)+) =&gt; { ... };
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Logs a message at the warn level.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>log::warn;
<span class="kw">let </span>warn_description = <span class="string">"Invalid Input"</span>;
<span class="macro">warn!</span>(<span class="string">"Warning! {warn_description}!"</span>);
<span class="macro">warn!</span>(target: <span class="string">"input_events"</span>, <span class="string">"App received warning: {warn_description}"</span>);
<span class="macro">warn!</span>(logger: my_logger, <span class="string">"App received warning: {warn_description}"</span>);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"constant":["STATIC_MAX_LEVEL"],"enum":["Level","LevelFilter"],"fn":["logger","max_level","set_boxed_logger","set_logger","set_logger_racy","set_max_level","set_max_level_racy"],"macro":["debug","error","info","log","log_enabled","trace","warn"],"struct":["Metadata","MetadataBuilder","ParseLevelError","Record","RecordBuilder","SetLoggerError"],"trait":["Log"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,28 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A trait encapsulating the operations required of a logger."><title>Log in log - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="log" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://prev.rust-lang.org/favicon.ico"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Log</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../log/index.html"><img src="https://prev.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="logo"></a><h2><a href="../log/index.html">log</a><span class="version">0.4.29</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Log</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.enabled" title="enabled">enabled</a></li><li><a href="#tymethod.flush" title="flush">flush</a></li><li><a href="#tymethod.log" title="log">log</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Log-for-%26T" title="&#38;T">&#38;T</a></li><li><a href="#impl-Log-for-Arc%3CT%3E" title="Arc&#60;T&#62;">Arc&#60;T&#62;</a></li><li><a href="#impl-Log-for-Box%3CT%3E" title="Box&#60;T&#62;">Box&#60;T&#62;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate log</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">log</a></div><h1>Trait <span class="trait">Log</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/log/lib.rs.html#1249-1280">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Log: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> {
// Required methods
fn <a href="#tymethod.enabled" class="fn">enabled</a>(&amp;self, metadata: &amp;<a class="struct" href="struct.Metadata.html" title="struct log::Metadata">Metadata</a>&lt;'_&gt;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.log" class="fn">log</a>(&amp;self, record: &amp;<a class="struct" href="struct.Record.html" title="struct log::Record">Record</a>&lt;'_&gt;);
<span class="item-spacer"></span> fn <a href="#tymethod.flush" class="fn">flush</a>(&amp;self);
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A trait encapsulating the operations required of a logger.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.enabled" class="method"><a class="src rightside" href="../src/log/lib.rs.html#1262">Source</a><h4 class="code-header">fn <a href="#tymethod.enabled" class="fn">enabled</a>(&amp;self, metadata: &amp;<a class="struct" href="struct.Metadata.html" title="struct log::Metadata">Metadata</a>&lt;'_&gt;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Determines if a log message with the specified metadata would be
logged.</p>
<p>This is used by the <code>log_enabled!</code> macro to allow callers to avoid
expensive computation of log message arguments if the message would be
discarded anyway.</p>
<h5 id="for-implementors"><a class="doc-anchor" href="#for-implementors">§</a>For implementors</h5>
<p>This method isnt called automatically by the <code>log!</code> macros.
Its up to an implementation of the <code>Log</code> trait to call <code>enabled</code> in its own
<code>log</code> method implementation to guarantee that filtering is applied.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.log" class="method"><a class="src rightside" href="../src/log/lib.rs.html#1271">Source</a><h4 class="code-header">fn <a href="#tymethod.log" class="fn">log</a>(&amp;self, record: &amp;<a class="struct" href="struct.Record.html" title="struct log::Record">Record</a>&lt;'_&gt;)</h4></section></summary><div class="docblock"><p>Logs the <code>Record</code>.</p>
<h5 id="for-implementors-1"><a class="doc-anchor" href="#for-implementors-1">§</a>For implementors</h5>
<p>Note that <code>enabled</code> is <em>not</em> necessarily called before this method.
Implementations of <code>log</code> should perform all necessary filtering
internally.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.flush" class="method"><a class="src rightside" href="../src/log/lib.rs.html#1279">Source</a><h4 class="code-header">fn <a href="#tymethod.flush" class="fn">flush</a>(&amp;self)</h4></section></summary><div class="docblock"><p>Flushes any buffered records.</p>
<h5 id="for-implementors-2"><a class="doc-anchor" href="#for-implementors-2">§</a>For implementors</h5>
<p>This method isnt called automatically by the <code>log!</code> macros.
It can be called manually on shut-down to ensure any in-flight records are flushed.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Log-for-%26T" class="impl"><a class="src rightside" href="../src/log/lib.rs.html#1294-1308">Source</a><a href="#impl-Log-for-%26T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;T</a><div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a>,</div></h3></section></summary><div class="impl-items"><section id="method.enabled" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1298-1300">Source</a><a href="#method.enabled" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.enabled" class="fn">enabled</a>(&amp;self, metadata: &amp;<a class="struct" href="struct.Metadata.html" title="struct log::Metadata">Metadata</a>&lt;'_&gt;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section><section id="method.log" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1302-1304">Source</a><a href="#method.log" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.log" class="fn">log</a>(&amp;self, record: &amp;<a class="struct" href="struct.Record.html" title="struct log::Record">Record</a>&lt;'_&gt;)</h4></section><section id="method.flush" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1305-1307">Source</a><a href="#method.flush" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.flush" class="fn">flush</a>(&amp;self)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Log-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../src/log/lib.rs.html#1311-1325">Source</a><a href="#impl-Log-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a>,</div></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>std</code></strong> only.</div></span></section></summary><div class="impl-items"><section id="method.enabled-1" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1315-1317">Source</a><a href="#method.enabled-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.enabled" class="fn">enabled</a>(&amp;self, metadata: &amp;<a class="struct" href="struct.Metadata.html" title="struct log::Metadata">Metadata</a>&lt;'_&gt;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section><section id="method.log-1" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1319-1321">Source</a><a href="#method.log-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.log" class="fn">log</a>(&amp;self, record: &amp;<a class="struct" href="struct.Record.html" title="struct log::Record">Record</a>&lt;'_&gt;)</h4></section><section id="method.flush-1" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1322-1324">Source</a><a href="#method.flush-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.flush" class="fn">flush</a>(&amp;self)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Log-for-Arc%3CT%3E" class="impl"><a class="src rightside" href="../src/log/lib.rs.html#1328-1342">Source</a><a href="#impl-Log-for-Arc%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;T&gt;<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.Log.html" title="trait log::Log">Log</a>,</div></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>std</code></strong> only.</div></span></section></summary><div class="impl-items"><section id="method.enabled-2" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1332-1334">Source</a><a href="#method.enabled-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.enabled" class="fn">enabled</a>(&amp;self, metadata: &amp;<a class="struct" href="struct.Metadata.html" title="struct log::Metadata">Metadata</a>&lt;'_&gt;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section><section id="method.log-2" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1336-1338">Source</a><a href="#method.log-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.log" class="fn">log</a>(&amp;self, record: &amp;<a class="struct" href="struct.Record.html" title="struct log::Record">Record</a>&lt;'_&gt;)</h4></section><section id="method.flush-2" class="method trait-impl"><a class="src rightside" href="../src/log/lib.rs.html#1339-1341">Source</a><a href="#method.flush-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.flush" class="fn">flush</a>(&amp;self)</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/log/trait.Log.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>