@qubit-ltd/logging 1.4.10 → 1.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/logging.cjs.map +1 -1
  2. package/dist/logging.iife.js.map +1 -1
  3. package/dist/logging.min.cjs.map +1 -1
  4. package/dist/logging.min.iife.js.map +1 -1
  5. package/dist/logging.min.mjs.map +1 -1
  6. package/dist/logging.mjs.map +1 -1
  7. package/doc/api/Logger.html +3 -3
  8. package/doc/api/global.html +5 -5
  9. package/doc/api/index.html +4 -4
  10. package/doc/api/scripts/core.js +719 -726
  11. package/doc/api/scripts/core.min.js +23 -23
  12. package/doc/api/scripts/resize.js +90 -90
  13. package/doc/api/scripts/search.js +267 -265
  14. package/doc/api/scripts/search.min.js +5 -5
  15. package/doc/api/scripts/third-party/Apache-License-2.0.txt +202 -202
  16. package/doc/api/scripts/third-party/fuse.js +1749 -9
  17. package/doc/api/scripts/third-party/hljs-line-num-original.js +367 -369
  18. package/doc/api/scripts/third-party/hljs-line-num.js +1 -1
  19. package/doc/api/scripts/third-party/hljs-original.js +5260 -5171
  20. package/doc/api/scripts/third-party/hljs.js +1 -1
  21. package/doc/api/scripts/third-party/popper.js +1287 -5
  22. package/doc/api/scripts/third-party/tippy.js +1499 -1
  23. package/doc/api/scripts/third-party/tocbot.js +757 -672
  24. package/doc/api/scripts/third-party/tocbot.min.js +1 -1
  25. package/doc/api/styles/clean-jsdoc-theme-base.css +1257 -1159
  26. package/doc/api/styles/clean-jsdoc-theme-dark.css +412 -412
  27. package/doc/api/styles/clean-jsdoc-theme-light.css +482 -482
  28. package/doc/api/styles/clean-jsdoc-theme-scrollbar.css +29 -29
  29. package/doc/api/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -1
  30. package/doc/api/styles/clean-jsdoc-theme.min.css +1 -1
  31. package/doc/logging.min.visualization.html +15 -15
  32. package/doc/logging.visualization.html +15 -15
  33. package/package.json +30 -28
@@ -1,3 +1,3 @@
1
- <!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Class: Logger</title><!--[if lt IE 9]>
2
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3
- <![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><header><h1 id="Logger-title" class="has-anchor">Logger</h1><div class="class-description"><p>A simple logging class.</p><p>A <code>Logger</code> object provides the following logging methods:</p><ul><li><code>Logger.trace(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>TRACE</code> level.</li><li><code>Logger.debug(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>DEBUG</code> level.</li><li><code>Logger.info(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>INFO</code> level.</li><li><code>Logger.warn(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>WARN</code> level.</li><li><code>Logger.error(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>ERROR</code> level.</li><li><code>Logger.log(level, message, arg1, arg2, ...)</code>: Outputs a log message with the specified level.</li></ul><p>The message argument of those logging methods supports the following substitution patterns:</p><ul><li><code>%o</code> or <code>%O</code>: Outputs a JavaScript object. Clicking the object name opens more information about it in the inspector.</li><li><code>%d</code> or <code>%i</code>: Outputs an integer. Number formatting is supported, for example <code>logger.info('Foo %.2d', 1.1)</code> will output the number as two significant figures with a leading 0: <code>Foo 01</code>.</li><li><code>%s</code>: Outputs a string.</li><li><code>%f</code>: Outputs a floating-point value. Formatting is supported, for example <code>logger.debug(&quot;Foo %.2f&quot;, 1.1)</code> will output the number to 2 decimal places: <code>Foo 1.10</code>.</li></ul></div></header><article><div class="container-overview"><h2 id="constructor" class="has-anchor">Constructor</h2><h3 class="name has-anchor" id="Logger"><span class="type-signature"></span>new Logger<span class="signature">(name, appender, level)</span></h3><div class="description"><p>Construct a log object.</p><p><strong>NOTE</strong>: Do NOT call this constructor directly. Use the static method <code>Logger.getLogger()</code> instead.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The optional name of this logger. The default value of this argument is an empty string.</p></td></tr><tr><td class="name"><code>appender</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>Optional, indicating the content output pipe of the log. This object must provide <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code> and <code>error</code> methods. The default value of this argument is <code>Logger.getDefaultAppender()</code>.</p></td></tr><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Optional, indicating the log level of this object. The default value of this argument is <code>Logger.getDefaultLevel()</code>.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-author bold">Author</dt><dd class="tag-author"><ul><li>Haixing Hu</li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getLogger">Logger.getLogger</a></li></ul></dd></div></dl></div><h2 id="methods" class="subsection-title has-anchor">Methods</h2><h3 class="name has-anchor" id="disable"><span class="type-signature"></span>disable<span class="signature">()</span></h3><div class="description"><p>Disable this logging object.</p></div><h3 class="name has-anchor" id="enable"><span class="type-signature"></span>enable<span class="signature">()</span></h3><div class="description"><p>Enable this logging object.</p></div><h3 class="name has-anchor" id="getAppender"><span class="type-signature"></span>getAppender<span class="signature">()</span><span class="type-signature"> &rarr; {object}</span></h3><div class="description"><p>Get the appender of this logger.</p></div><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The appender of this logger.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type">object</span></dd></dl></div><h3 class="name has-anchor" id="getLevel"><span class="type-signature"></span>getLevel<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h3><div class="description"><p>Get the logging level of this logger.</p></div><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The logging level of this logger. Possible return values are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type">string</span></dd></dl></div><h3 class="name has-anchor" id="getName"><span class="type-signature"></span>getName<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h3><div class="description"><p>Get the name of this logger.</p></div><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The name of this logger.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type">string</span></dd></dl></div><h3 class="name has-anchor" id="log"><span class="type-signature"></span>log<span class="signature">(level, message, &hellip;args)</span></h3><div class="description"><p>Logs a message in the specified logging level.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th>Attributes</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="attributes"></td><td class="description last"><p>the logging level.</p></td></tr><tr><td class="name"><code>message</code></td><td class="type"><span class="param-type">string</span></td><td class="attributes"></td><td class="description last"><p>the message or message template, which may contain zero or more substitution patterns, e.g., '%o', '%s', '%d', '%f', ..., etc.</p></td></tr><tr><td class="name"><code>args</code></td><td class="type"><span class="param-type">array</span></td><td class="attributes">&lt;repeatable><br></td><td class="description last"><p>the array of arguments used to format the message.</p></td></tr></tbody></table></div><h3 class="name has-anchor" id="setAppender"><span class="type-signature"></span>setAppender<span class="signature">(appender)</span></h3><div class="description"><p>Set up a new Appender.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>appender</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>The new Appender serves as the content output pipeline of the log. This object must provide <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code> and <code>error</code> methods.</p></td></tr></tbody></table></div><h3 class="name has-anchor" id="setEnabled"><span class="type-signature"></span>setEnabled<span class="signature">(enabled)</span></h3><div class="description"><p>Enable or disable this log object.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>enabled</code></td><td class="type"><span class="param-type">boolean</span></td><td class="description last"><p>Whether to enable this log object.</p></td></tr></tbody></table></div><h3 class="name has-anchor" id="setLevel"><span class="type-signature"></span>setLevel<span class="signature">(level)</span></h3><div class="description"><p>Set the logging level of this logger.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The new logging level. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed.</p></td></tr></tbody></table></div><h3 class="name has-anchor" id=".clearAllLoggers"><span class="type-signature">(static) </span>clearAllLoggers<span class="signature">()</span></h3><div class="description"><p>Clears all existing <code>Logger</code> instances.</p></div><h3 class="name has-anchor" id=".getDefaultAppender"><span class="type-signature">(static) </span>getDefaultAppender<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h3><div class="description"><p>Gets the default logging appender.</p><p>The default logging appender is used to construct a new <code>Logger</code> instance if the logging appender of the new instance is not specified.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.setDefaultAppender">Logger.setDefaultAppender</a></li><li><a href="Logger.html#.setAllAppenders">Logger.setAllAppenders</a></li><li><a href="Logger.html#.resetAllAppenders">Logger.resetAllAppenders</a></li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The default logging appender.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type">Object</span></dd></dl></div><h3 class="name has-anchor" id=".getDefaultLevel"><span class="type-signature">(static) </span>getDefaultLevel<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h3><div class="description"><p>Gets the default logging level.</p><p>The default logging level is used to construct a new <code>Logger</code> instance if the logging level of the new instance is not specified.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.setDefaultLevel">Logger.setDefaultLevel</a></li><li><a href="Logger.html#.setAllLevels">Logger.setAllLevels</a></li><li><a href="Logger.html#.resetAllLevels">Logger.resetAllLevels</a></li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The global default logging level.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type">string</span></dd></dl></div><h3 class="name has-anchor" id=".getLogger"><span class="type-signature">(static) </span>getLogger<span class="signature">(name, options)</span><span class="type-signature"> &rarr; {<a href="Logger.html">Logger</a>}</span></h3><div class="description"><p>Gets the <code>Logger</code> instance of the specified name, or constructs a new <code>Logger</code> instance if it does not exist.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The name of the <code>Logger</code> instance to be retrieved.</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">Object</span></td><td class="description last"><p>The optional options of the <code>Logger</code> instance to be retrieved. This option object may have the following properties: - <code>appender: object</code>: the specified content output pipe of the log. This object must provide <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code> and <code>error</code> methods. If this option is not provided, the appender of the existing <code>Logger</code> instance will not be changed, and the default appender will be used to construct a new <code>Logger</code> instance if it does not exist. - <code>level: string</code>: the logging level of the <code>Logger</code> instance to be retrieved. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed. If this option is not provided, the logging level of the existing <code>Logger</code> instance will not be changed, and the default logging level will be used to construct a new <code>Logger</code> instance if it does not exist.</p></td></tr></tbody></table></div><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The <code>Logger</code> instance of the specified name, which either be the existing one or a newly constructed one.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type"><a href="Logger.html">Logger</a></span></dd></dl></div><h3 class="name has-anchor" id=".getLoggerLevel"><span class="type-signature">(static) </span>getLoggerLevel<span class="signature">(name)</span><span class="type-signature"> &rarr; {string}</span></h3><div class="description"><p>Gets the logging level of the <code>Logger</code> instance of the specified name.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"></td><td class="description last"><p>The name of the <code>Logger</code> instance.</p></td></tr></tbody></table></div><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The logging level of the <code>Logger</code> instance of the specified name. If the <code>Logger</code> instance of the specified name does not exist, the default logging level will be returned.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type">string</span></dd></dl></div><h3 class="name has-anchor" id=".reset"><span class="type-signature">(static) </span>reset<span class="signature">()</span></h3><div class="description"><p>Resets all configurations of the <code>Logger</code> class to the factory values.</p><p>This method is equivalent to calling the following methods in sequence:</p><ul><li><code>Logger.clearAllLoggers()</code></li><li><code>Logger.resetDefaultLevel()</code></li><li><code>Logger.resetDefaultAppender()</code></li></ul></div><h3 class="name has-anchor" id=".resetAllAppenders"><span class="type-signature">(static) </span>resetAllAppenders<span class="signature">()</span></h3><div class="description"><p>Sets the appender of all <code>Logger</code> instants to the default appender.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultAppender">Logger.getDefaultAppender</a></li><li><a href="Logger.html#.setDefaultAppender">Logger.setDefaultAppender</a></li><li><a href="Logger.html#.setAllAppenders">Logger.setAllAppenders</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".resetAllLevels"><span class="type-signature">(static) </span>resetAllLevels<span class="signature">()</span></h3><div class="description"><p>Sets the logging level of all <code>Logger</code> instants to the default logging level.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultLevel">Logger.getDefaultLevel</a></li><li><a href="Logger.html#.setDefaultLevel">Logger.setDefaultLevel</a></li><li><a href="Logger.html#.setAllLevels">Logger.setAllLevels</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".resetDefaultAppender"><span class="type-signature">(static) </span>resetDefaultAppender<span class="signature">()</span></h3><div class="description"><p>Resets the default logging appender to the factory value.</p><p>The default logging appender is used to construct a new <code>Logger</code> instance if the logging appender of the new instance is not specified.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultAppender">Logger.getDefaultAppender</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".resetDefaultLevel"><span class="type-signature">(static) </span>resetDefaultLevel<span class="signature">()</span></h3><div class="description"><p>Resets the default logging level to the factory value.</p><p>The default logging level is used to construct a new <code>Logger</code> instance if the logging level of the new instance is not specified.</p></div><h3 class="name has-anchor" id=".setAllAppenders"><span class="type-signature">(static) </span>setAllAppenders<span class="signature">(appender)</span></h3><div class="description"><p>Sets the appender of all <code>Logger</code> instants.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>appender</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>The new appender to be set, indicating the content output pipe of the log. This object must provide <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code> and <code>error</code> methods.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultAppender">Logger.getDefaultAppender</a></li><li><a href="Logger.html#.setDefaultAppender">Logger.setDefaultAppender</a></li><li><a href="Logger.html#.resetAllAppenders">Logger.resetAllAppenders</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".setAllLevels"><span class="type-signature">(static) </span>setAllLevels<span class="signature">(level)</span></h3><div class="description"><p>Sets the logging level of all existing <code>Logger</code> instants.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The new logging level of all existing <code>Logger</code> instants. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultLevel">Logger.getDefaultLevel</a></li><li><a href="Logger.html#.setDefaultLevel">Logger.setDefaultLevel</a></li><li><a href="Logger.html#.resetAllLevels">Logger.resetAllLevels</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".setDefaultAppender"><span class="type-signature">(static) </span>setDefaultAppender<span class="signature">(appender)</span></h3><div class="description"><p>Sets the default logging appender.</p><p>The default logging appender is used to construct a new <code>Logger</code> instance if the logging appender of the new instance is not specified.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>appender</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>The new default logging appender.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultAppender">Logger.getDefaultAppender</a></li><li><a href="Logger.html#.setAllAppenders">Logger.setAllAppenders</a></li><li><a href="Logger.html#.resetAllAppenders">Logger.resetAllAppenders</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".setDefaultLevel"><span class="type-signature">(static) </span>setDefaultLevel<span class="signature">(level)</span></h3><div class="description"><p>Sets the default logging level.</p><p>The default logging level is used to construct a new <code>Logger</code> instance if the logging level of the new instance is not specified.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The new default logging level. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">See</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultLevel">Logger.getDefaultLevel</a></li><li><a href="Logger.html#.setAllLevels">Logger.setAllLevels</a></li><li><a href="Logger.html#.resetAllLevels">Logger.resetAllLevels</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".setLoggerLevel"><span class="type-signature">(static) </span>setLoggerLevel<span class="signature">(name, level)</span></h3><div class="description"><p>Sets the logging level of the <code>Logger</code> instance of the specified name.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"></td><td class="description last"><p>The name of the <code>Logger</code> instance.</p></td></tr><tr><td class="name"><code>level</code></td><td class="type"></td><td class="description last"><p>The new logging level of the <code>Logger</code> instance of the specified name. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed.</p></td></tr></tbody></table></div></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
1
+ <!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Class: Logger</title><!--[if lt IE 9]>
2
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3
+ <![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="home-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M19 21H5a1 1 0 0 1-1-1v-9H1l10.327-9.388a1 1 0 0 1 1.346 0L23 11h-3v9a1 1 0 0 1-1 1zM6 19h12V9.157l-6-5.454-6 5.454V19z"/></symbol><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title"><a href="index.html" class="sidebar-home-anchor">首页</a></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-类"><div>类</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-全局"><div>全局</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button home-button" aria-label="go-to-homepage"><svg><use xlink:href="#home-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">本页内容</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><header><h1 id="Logger-title" class="has-anchor">Logger</h1><div class="class-description"><p>A simple logging class.</p><p>A <code>Logger</code> object provides the following logging methods:</p><ul><li><code>Logger.trace(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>TRACE</code> level.</li><li><code>Logger.debug(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>DEBUG</code> level.</li><li><code>Logger.info(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>INFO</code> level.</li><li><code>Logger.warn(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>WARN</code> level.</li><li><code>Logger.error(message, arg1, arg2, ...)</code>: Outputs a log message with the <code>ERROR</code> level.</li><li><code>Logger.log(level, message, arg1, arg2, ...)</code>: Outputs a log message with the specified level.</li></ul><p>The message argument of those logging methods supports the following substitution patterns:</p><ul><li><code>%o</code> or <code>%O</code>: Outputs a JavaScript object. Clicking the object name opens more information about it in the inspector.</li><li><code>%d</code> or <code>%i</code>: Outputs an integer. Number formatting is supported, for example <code>logger.info('Foo %.2d', 1.1)</code> will output the number as two significant figures with a leading 0: <code>Foo 01</code>.</li><li><code>%s</code>: Outputs a string.</li><li><code>%f</code>: Outputs a floating-point value. Formatting is supported, for example <code>logger.debug(&quot;Foo %.2f&quot;, 1.1)</code> will output the number to 2 decimal places: <code>Foo 1.10</code>.</li></ul></div></header><article><div class="container-overview"><h2 id="constructor" class="has-anchor">构造函数</h2><h3 class="name has-anchor" id="Logger"><span class="type-signature"></span>new Logger<span class="signature">(name, appender, level)</span></h3><div class="description"><p>Construct a log object.</p><p><strong>NOTE</strong>: Do NOT call this constructor directly. Use the static method <code>Logger.getLogger()</code> instead.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The optional name of this logger. The default value of this argument is an empty string.</p></td></tr><tr><td class="name"><code>appender</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>Optional, indicating the content output pipe of the log. This object must provide <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code> and <code>error</code> methods. The default value of this argument is <code>Logger.getDefaultAppender()</code>.</p></td></tr><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>Optional, indicating the log level of this object. The default value of this argument is <code>Logger.getDefaultLevel()</code>.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-author bold">作者</dt><dd class="tag-author"><ul><li>Haixing Hu</li></ul></dd></div><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getLogger">Logger.getLogger</a></li></ul></dd></div></dl></div><h2 id="methods" class="subsection-title has-anchor">方法</h2><h3 class="name has-anchor" id="disable"><span class="type-signature"></span>disable<span class="signature">()</span></h3><div class="description"><p>Disable this logging object.</p></div><h3 class="name has-anchor" id="enable"><span class="type-signature"></span>enable<span class="signature">()</span></h3><div class="description"><p>Enable this logging object.</p></div><h3 class="name has-anchor" id="getAppender"><span class="type-signature"></span>getAppender<span class="signature">()</span><span class="type-signature"> &rarr; {object}</span></h3><div class="description"><p>Get the appender of this logger.</p></div><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>The appender of this logger.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type">object</span></dd></dl></div><h3 class="name has-anchor" id="getLevel"><span class="type-signature"></span>getLevel<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h3><div class="description"><p>Get the logging level of this logger.</p></div><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>The logging level of this logger. Possible return values are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type">string</span></dd></dl></div><h3 class="name has-anchor" id="getName"><span class="type-signature"></span>getName<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h3><div class="description"><p>Get the name of this logger.</p></div><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>The name of this logger.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type">string</span></dd></dl></div><h3 class="name has-anchor" id="log"><span class="type-signature"></span>log<span class="signature">(level, message, &hellip;args)</span></h3><div class="description"><p>Logs a message in the specified logging level.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th>特性</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="attributes"></td><td class="description last"><p>the logging level.</p></td></tr><tr><td class="name"><code>message</code></td><td class="type"><span class="param-type">string</span></td><td class="attributes"></td><td class="description last"><p>the message or message template, which may contain zero or more substitution patterns, e.g., '%o', '%s', '%d', '%f', ..., etc.</p></td></tr><tr><td class="name"><code>args</code></td><td class="type"><span class="param-type">array</span></td><td class="attributes">&lt;可重复><br></td><td class="description last"><p>the array of arguments used to format the message.</p></td></tr></tbody></table></div><h3 class="name has-anchor" id="setAppender"><span class="type-signature"></span>setAppender<span class="signature">(appender)</span></h3><div class="description"><p>Set up a new Appender.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>appender</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>The new Appender serves as the content output pipeline of the log. This object must provide <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code> and <code>error</code> methods.</p></td></tr></tbody></table></div><h3 class="name has-anchor" id="setEnabled"><span class="type-signature"></span>setEnabled<span class="signature">(enabled)</span></h3><div class="description"><p>Enable or disable this log object.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>enabled</code></td><td class="type"><span class="param-type">boolean</span></td><td class="description last"><p>Whether to enable this log object.</p></td></tr></tbody></table></div><h3 class="name has-anchor" id="setLevel"><span class="type-signature"></span>setLevel<span class="signature">(level)</span></h3><div class="description"><p>Set the logging level of this logger.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The new logging level. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed.</p></td></tr></tbody></table></div><h3 class="name has-anchor" id=".clearAllLoggers"><span class="type-signature">(static) </span>clearAllLoggers<span class="signature">()</span></h3><div class="description"><p>Clears all existing <code>Logger</code> instances.</p></div><h3 class="name has-anchor" id=".getDefaultAppender"><span class="type-signature">(static) </span>getDefaultAppender<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h3><div class="description"><p>Gets the default logging appender.</p><p>The default logging appender is used to construct a new <code>Logger</code> instance if the logging appender of the new instance is not specified.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.setDefaultAppender">Logger.setDefaultAppender</a></li><li><a href="Logger.html#.setAllAppenders">Logger.setAllAppenders</a></li><li><a href="Logger.html#.resetAllAppenders">Logger.resetAllAppenders</a></li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>The default logging appender.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type">Object</span></dd></dl></div><h3 class="name has-anchor" id=".getDefaultLevel"><span class="type-signature">(static) </span>getDefaultLevel<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h3><div class="description"><p>Gets the default logging level.</p><p>The default logging level is used to construct a new <code>Logger</code> instance if the logging level of the new instance is not specified.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.setDefaultLevel">Logger.setDefaultLevel</a></li><li><a href="Logger.html#.setAllLevels">Logger.setAllLevels</a></li><li><a href="Logger.html#.resetAllLevels">Logger.resetAllLevels</a></li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>The global default logging level.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type">string</span></dd></dl></div><h3 class="name has-anchor" id=".getLogger"><span class="type-signature">(static) </span>getLogger<span class="signature">(name, options)</span><span class="type-signature"> &rarr; {<a href="Logger.html">Logger</a>}</span></h3><div class="description"><p>Gets the <code>Logger</code> instance of the specified name, or constructs a new <code>Logger</code> instance if it does not exist.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The name of the <code>Logger</code> instance to be retrieved.</p></td></tr><tr><td class="name"><code>options</code></td><td class="type"><span class="param-type">Object</span></td><td class="description last"><p>The optional options of the <code>Logger</code> instance to be retrieved. This option object may have the following properties: - <code>appender: object</code>: the specified content output pipe of the log. This object must provide <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code> and <code>error</code> methods. If this option is not provided, the appender of the existing <code>Logger</code> instance will not be changed, and the default appender will be used to construct a new <code>Logger</code> instance if it does not exist. - <code>level: string</code>: the logging level of the <code>Logger</code> instance to be retrieved. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed. If this option is not provided, the logging level of the existing <code>Logger</code> instance will not be changed, and the default logging level will be used to construct a new <code>Logger</code> instance if it does not exist.</p></td></tr></tbody></table></div><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>The <code>Logger</code> instance of the specified name, which either be the existing one or a newly constructed one.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type"><a href="Logger.html">Logger</a></span></dd></dl></div><h3 class="name has-anchor" id=".getLoggerLevel"><span class="type-signature">(static) </span>getLoggerLevel<span class="signature">(name)</span><span class="type-signature"> &rarr; {string}</span></h3><div class="description"><p>Gets the logging level of the <code>Logger</code> instance of the specified name.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"></td><td class="description last"><p>The name of the <code>Logger</code> instance.</p></td></tr></tbody></table></div><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>The logging level of the <code>Logger</code> instance of the specified name. If the <code>Logger</code> instance of the specified name does not exist, the default logging level will be returned.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type">string</span></dd></dl></div><h3 class="name has-anchor" id=".reset"><span class="type-signature">(static) </span>reset<span class="signature">()</span></h3><div class="description"><p>Resets all configurations of the <code>Logger</code> class to the factory values.</p><p>This method is equivalent to calling the following methods in sequence:</p><ul><li><code>Logger.clearAllLoggers()</code></li><li><code>Logger.resetDefaultLevel()</code></li><li><code>Logger.resetDefaultAppender()</code></li></ul></div><h3 class="name has-anchor" id=".resetAllAppenders"><span class="type-signature">(static) </span>resetAllAppenders<span class="signature">()</span></h3><div class="description"><p>Sets the appender of all <code>Logger</code> instants to the default appender.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultAppender">Logger.getDefaultAppender</a></li><li><a href="Logger.html#.setDefaultAppender">Logger.setDefaultAppender</a></li><li><a href="Logger.html#.setAllAppenders">Logger.setAllAppenders</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".resetAllLevels"><span class="type-signature">(static) </span>resetAllLevels<span class="signature">()</span></h3><div class="description"><p>Sets the logging level of all <code>Logger</code> instants to the default logging level.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultLevel">Logger.getDefaultLevel</a></li><li><a href="Logger.html#.setDefaultLevel">Logger.setDefaultLevel</a></li><li><a href="Logger.html#.setAllLevels">Logger.setAllLevels</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".resetDefaultAppender"><span class="type-signature">(static) </span>resetDefaultAppender<span class="signature">()</span></h3><div class="description"><p>Resets the default logging appender to the factory value.</p><p>The default logging appender is used to construct a new <code>Logger</code> instance if the logging appender of the new instance is not specified.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultAppender">Logger.getDefaultAppender</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".resetDefaultLevel"><span class="type-signature">(static) </span>resetDefaultLevel<span class="signature">()</span></h3><div class="description"><p>Resets the default logging level to the factory value.</p><p>The default logging level is used to construct a new <code>Logger</code> instance if the logging level of the new instance is not specified.</p></div><h3 class="name has-anchor" id=".setAllAppenders"><span class="type-signature">(static) </span>setAllAppenders<span class="signature">(appender)</span></h3><div class="description"><p>Sets the appender of all <code>Logger</code> instants.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>appender</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>The new appender to be set, indicating the content output pipe of the log. This object must provide <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code> and <code>error</code> methods.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultAppender">Logger.getDefaultAppender</a></li><li><a href="Logger.html#.setDefaultAppender">Logger.setDefaultAppender</a></li><li><a href="Logger.html#.resetAllAppenders">Logger.resetAllAppenders</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".setAllLevels"><span class="type-signature">(static) </span>setAllLevels<span class="signature">(level)</span></h3><div class="description"><p>Sets the logging level of all existing <code>Logger</code> instants.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The new logging level of all existing <code>Logger</code> instants. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultLevel">Logger.getDefaultLevel</a></li><li><a href="Logger.html#.setDefaultLevel">Logger.setDefaultLevel</a></li><li><a href="Logger.html#.resetAllLevels">Logger.resetAllLevels</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".setDefaultAppender"><span class="type-signature">(static) </span>setDefaultAppender<span class="signature">(appender)</span></h3><div class="description"><p>Sets the default logging appender.</p><p>The default logging appender is used to construct a new <code>Logger</code> instance if the logging appender of the new instance is not specified.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>appender</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>The new default logging appender.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultAppender">Logger.getDefaultAppender</a></li><li><a href="Logger.html#.setAllAppenders">Logger.setAllAppenders</a></li><li><a href="Logger.html#.resetAllAppenders">Logger.resetAllAppenders</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".setDefaultLevel"><span class="type-signature">(static) </span>setDefaultLevel<span class="signature">(level)</span></h3><div class="description"><p>Sets the default logging level.</p><p>The default logging level is used to construct a new <code>Logger</code> instance if the logging level of the new instance is not specified.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>level</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The new default logging level. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-see bold">参见</dt><dd class="tag-see"><ul><li><a href="Logger.html#.getDefaultLevel">Logger.getDefaultLevel</a></li><li><a href="Logger.html#.setAllLevels">Logger.setAllLevels</a></li><li><a href="Logger.html#.resetAllLevels">Logger.resetAllLevels</a></li></ul></dd></div></dl><h3 class="name has-anchor" id=".setLoggerLevel"><span class="type-signature">(static) </span>setLoggerLevel<span class="signature">(name, level)</span></h3><div class="description"><p>Sets the logging level of the <code>Logger</code> instance of the specified name.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>name</code></td><td class="type"></td><td class="description last"><p>The name of the <code>Logger</code> instance.</p></td></tr><tr><td class="name"><code>level</code></td><td class="type"></td><td class="description last"><p>The new logging level of the <code>Logger</code> instance of the specified name. The allowed levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, <code>ERROR</code>, and <code>NONE</code>. Lowercase letters are also allowed.</p></td></tr></tbody></table></div></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="关闭搜索"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="搜索..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">输入任何内容查看搜索结果</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title"><a href="index.html" class="sidebar-home-anchor">首页</a></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-类"><div>类</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-全局"><div>全局</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button home-button" aria-label="go-to-homepage"><svg><use xlink:href="#home-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script><script>document.addEventListener("DOMContentLoaded",(function(){"undefined"!=typeof tippy&&(tippy(".home-button",{content:"回到首页",delay:500}),tippy(".theme-toggle",{content:"切换主题",delay:500}),tippy(".search-button",{content:"搜索",delay:500}),tippy(".font-size",{content:"更改字体大小",delay:500}))}))</script></body></html>
@@ -1,6 +1,6 @@
1
- <!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Global</title><!--[if lt IE 9]>
2
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3
- <![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><article><div class="container-overview"></div><h2 id="members" class="subsection-title has-anchor">Members</h2><h3 class="name has-anchor" id="FACTORY_DEFAULT_APPENDER"><span class="type-signature">(constant) </span>FACTORY_DEFAULT_APPENDER<span class="type-signature"> :Console</span></h3><div class="description"><p>The factory value of the Logger class's default log appender, which is the standard output pipe of the console.</p></div><div class="member-item-container flex"><strong>Type:</strong><ul><li><span class="param-type">Console</span></li></ul></div><h3 class="name has-anchor" id="FACTORY_DEFAULT_LEVEL"><span class="type-signature">(constant) </span>FACTORY_DEFAULT_LEVEL<span class="type-signature"> :string</span></h3><div class="description"><p>The factory value of the Logger class's default logging level, which is <code>DEBUG</code>.</p></div><div class="member-item-container flex"><strong>Type:</strong><ul><li><span class="param-type">string</span></li></ul></div><h3 class="name has-anchor" id="LOGGING_LEVELS"><span class="type-signature">(constant) </span>LOGGING_LEVELS<span class="type-signature"></span></h3><div class="description"><p>Predefined logging levels.</p></div><dl class="details"><div class="details-item-container"><dt class="tag-author bold">Author</dt><dd class="tag-author"><ul><li>Haixing Hu</li></ul></dd></div></dl><h2 id="methods" class="subsection-title has-anchor">Methods</h2><h3 class="name has-anchor" id="HasLogger"><span class="type-signature"></span>HasLogger<span class="signature">(Class, context)</span><span class="type-signature"> &rarr; {function}</span></h3><div class="description"><p>A decorator to add a named logger to a class.</p><p>This decorator will add a named logger to the class, which can be accessed via the <code>logger</code> property of the class.</p><p>Example usage:</p><pre class="prettyprint source lang-js"><code>import { HasLogger } from '@haixing_hu/logging';
1
+ <!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Global</title><!--[if lt IE 9]>
2
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3
+ <![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="home-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M19 21H5a1 1 0 0 1-1-1v-9H1l10.327-9.388a1 1 0 0 1 1.346 0L23 11h-3v9a1 1 0 0 1-1 1zM6 19h12V9.157l-6-5.454-6 5.454V19z"/></symbol><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title"><a href="index.html" class="sidebar-home-anchor">首页</a></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-类"><div>类</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-全局"><div>全局</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button home-button" aria-label="go-to-homepage"><svg><use xlink:href="#home-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">本页内容</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><article><div class="container-overview"></div><h2 id="properties" class="subsection-title has-anchor">属性</h2><div class="allow-overflow"><table class="props"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>FACTORY_DEFAULT_APPENDER</code></td><td class="type"><span class="param-type">Console</span></td><td class="description last"><p>The factory value of the Logger class's default log appender, which is the standard output pipe of the console.</p></td></tr><tr><td class="name"><code>FACTORY_DEFAULT_LEVEL</code></td><td class="type"><span class="param-type">string</span></td><td class="description last"><p>The factory value of the Logger class's default logging level, which is <code>DEBUG</code>.</p></td></tr><tr><td class="name"><code>LOGGING_LEVELS</code></td><td class="type"></td><td class="description last"><p>Predefined logging levels.</p></td></tr></tbody></table></div><h2 id="methods" class="subsection-title has-anchor">方法</h2><h3 class="name has-anchor" id="HasLogger"><span class="type-signature"></span>HasLogger<span class="signature">(Class, context)</span><span class="type-signature"> &rarr; {function}</span></h3><div class="description"><p>A decorator to add a named logger to a class.</p><p>This decorator will add a named logger to the class, which can be accessed via the <code>logger</code> property of the class.</p><p>Example usage:</p><pre class="prettyprint source lang-js"><code>import { HasLogger } from '@haixing_hu/logging';
4
4
 
5
5
  &#064;HasLogger
6
6
  class MyClass {
@@ -23,7 +23,7 @@ class MyComponent {
23
23
  }
24
24
 
25
25
  export default toVue(MyComponent);
26
- </code></pre><p><strong>NOTE</strong>: the order of the decorators is IMPORTANT. The <code>@HasLogger</code> decorator must be placed <strong>AFTER</strong> the <code>@Component</code> decorator.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>Class</code></td><td class="type"><span class="param-type">function</span></td><td class="description last"><p>the target class to be decorated.</p></td></tr><tr><td class="name"><code>context</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>the context object containing information about the class to be decorated.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-author bold">Author</dt><dd class="tag-author"><ul><li>Haixing Hu</li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>the new constructor of the decorated class.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type">function</span></dd></dl></div><h3 class="name has-anchor" id="Log"><span class="type-signature"></span>Log<span class="signature">(target, context)</span><span class="type-signature"> &rarr; {function}</span></h3><div class="description"><p>Defines a class method decorator that modifies the target method and prints its calling signature in the log, including class name, method name and parameters.</p><p>Note that only non-constructor class method can be decorated by this decorator. The global function and class constructor CANNOT be decorated by this decorator.</p><p>Usage example:</p><pre class="prettyprint source lang-js"><code>import { Log } from '@haixing_hu/logging';
26
+ </code></pre><p><strong>NOTE</strong>: the order of the decorators is IMPORTANT. The <code>@HasLogger</code> decorator must be placed <strong>AFTER</strong> the <code>@Component</code> decorator.</p></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>Class</code></td><td class="type"><span class="param-type">function</span></td><td class="description last"><p>the target class to be decorated.</p></td></tr><tr><td class="name"><code>context</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>the context object containing information about the class to be decorated.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-author bold">作者</dt><dd class="tag-author"><ul><li>Haixing Hu</li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>the new constructor of the decorated class.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type">function</span></dd></dl></div><h3 class="name has-anchor" id="Log"><span class="type-signature"></span>Log<span class="signature">(target, context)</span><span class="type-signature"> &rarr; {function}</span></h3><div class="description"><p>Defines a class method decorator that modifies the target method and prints its calling signature in the log, including class name, method name and parameters.</p><p>Note that only non-constructor class method can be decorated by this decorator. The global function and class constructor CANNOT be decorated by this decorator.</p><p>Usage example:</p><pre class="prettyprint source lang-js"><code>import { Log } from '@haixing_hu/logging';
27
27
 
28
28
  class Person {
29
29
  &#064;Log
@@ -35,4 +35,4 @@ class Person {
35
35
  const person = new Person();
36
36
  const meal = new Meal();
37
37
  person.eat(meal); // 日志中将会打印此方法调用的签名
38
- </code></pre></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>Parameters:</strong><table class="params"><thead><tr><th>Name</th><th>Type</th><th class="last">Description</th></tr></thead><tbody><tr><td class="name"><code>target</code></td><td class="type"><span class="param-type">function</span></td><td class="description last"><p>The method being decorated.</p></td></tr><tr><td class="name"><code>context</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>the context object containing information about the method to be decorated.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-author bold">Author</dt><dd class="tag-author"><ul><li>Haixing Hu</li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc"><p>The decorated method.</p></div><dl class="param-type"><dt>Type:&nbsp;</dt><dd><span class="param-type">function</span></dd></dl></div></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
38
+ </code></pre></div><div class="method-member-container flex flex-col w-100 overflow-auto mt-20"><strong>参数:</strong><table class="params"><thead><tr><th>名称</th><th>类型</th><th class="last">描述</th></tr></thead><tbody><tr><td class="name"><code>target</code></td><td class="type"><span class="param-type">function</span></td><td class="description last"><p>The method being decorated.</p></td></tr><tr><td class="name"><code>context</code></td><td class="type"><span class="param-type">object</span></td><td class="description last"><p>the context object containing information about the method to be decorated.</p></td></tr></tbody></table></div><dl class="details"><div class="details-item-container"><dt class="tag-author bold">作者</dt><dd class="tag-author"><ul><li>Haixing Hu</li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>返回值:</strong><div class="param-desc"><p>The decorated method.</p></div><dl class="param-type"><dt>类型:&nbsp;</dt><dd><span class="param-type">function</span></dd></dl></div></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="关闭搜索"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="搜索..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">输入任何内容查看搜索结果</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title"><a href="index.html" class="sidebar-home-anchor">首页</a></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-类"><div>类</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-全局"><div>全局</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button home-button" aria-label="go-to-homepage"><svg><use xlink:href="#home-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script><script>document.addEventListener("DOMContentLoaded",(function(){"undefined"!=typeof tippy&&(tippy(".home-button",{content:"回到首页",delay:500}),tippy(".theme-toggle",{content:"切换主题",delay:500}),tippy(".search-button",{content:"搜索",delay:500}),tippy(".font-size",{content:"更改字体大小",delay:500}))}))</script></body></html>
@@ -1,6 +1,6 @@
1
- <!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Home</title><!--[if lt IE 9]>
2
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3
- <![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section class="readme"><article><h1>js-logging</h1><p><a href="https://npmjs.com/package/@qubit-ltd/logging"><img src="https://img.shields.io/npm/v/@qubit-ltd/logging.svg" alt="npm package"></a><a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache-blue.svg" alt="License"></a><a href="README.md"><img src="https://img.shields.io/badge/Document-English-blue.svg" alt="English Document"></a><a href="https://dl.circleci.com/status-badge/redirect/gh/Haixing-Hu/js-logging/tree/master"><img src="https://dl.circleci.com/status-badge/img/gh/Haixing-Hu/js-logging/tree/master.svg?style=shield" alt="CircleCI"></a><a href="https://coveralls.io/github/Haixing-Hu/js-logging?branch=master"><img src="https://coveralls.io/repos/github/Haixing-Hu/js-logging/badge.svg?branch=master" alt="Coverage Status"></a></p><p><a href="https://npmjs.com/package/@qubit-ltd/logging">@qubit-ltd/logging</a> 是一个 JavaScript 库,通过装饰器为类方法和属性提供强大的日志记录功能。 该库旨在与<a href="https://github.com/Haixing-Hu/vue3-class-component/">Vue.js 类组件</a>无缝集成,为处理 JavaScript 项目中的日志记录提供了优雅的解决方案。</p><h2>特性</h2><ul><li>📝 简单灵活的日志接口,支持不同的日志级别</li><li>🔍 支持带占位符的格式化日志消息</li><li>🎯 自动方法日志记录和类日志集成的装饰器</li><li>🔄 与Vue.js类组件无缝集成</li><li>🎛️ 可配置的日志级别和输出器</li><li>🌐 全局和单独的日志记录器管理</li><li>📋 支持浏览器控制台和自定义输出器</li></ul><h2>安装</h2><p>使用 npm 或 yarn 安装该库:</p><pre class="prettyprint source lang-sh"><code>npm install @qubit-ltd/logging
1
+ <!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Home</title><!--[if lt IE 9]>
2
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3
+ <![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="home-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M19 21H5a1 1 0 0 1-1-1v-9H1l10.327-9.388a1 1 0 0 1 1.346 0L23 11h-3v9a1 1 0 0 1-1 1zM6 19h12V9.157l-6-5.454-6 5.454V19z"/></symbol><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title"><a href="index.html" class="sidebar-home-anchor">首页</a></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-类"><div>类</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-全局"><div>全局</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button home-button" aria-label="go-to-homepage"><svg><use xlink:href="#home-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">本页内容</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section class="readme"><article><h1>js-logging</h1><p><a href="https://npmjs.com/package/@qubit-ltd/logging"><img src="https://img.shields.io/npm/v/@qubit-ltd/logging.svg" alt="npm package"></a><a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache-blue.svg" alt="License"></a><a href="README.md"><img src="https://img.shields.io/badge/Document-English-blue.svg" alt="English Document"></a><a href="https://dl.circleci.com/status-badge/redirect/gh/Haixing-Hu/js-logging/tree/master"><img src="https://dl.circleci.com/status-badge/img/gh/Haixing-Hu/js-logging/tree/master.svg?style=shield" alt="CircleCI"></a><a href="https://coveralls.io/github/Haixing-Hu/js-logging?branch=master"><img src="https://coveralls.io/repos/github/Haixing-Hu/js-logging/badge.svg?branch=master" alt="Coverage Status"></a></p><p><a href="https://npmjs.com/package/@qubit-ltd/logging">@qubit-ltd/logging</a> 是一个 JavaScript 库,通过装饰器为类方法和属性提供强大的日志记录功能。 该库旨在与<a href="https://github.com/Haixing-Hu/vue3-class-component/">Vue.js 类组件</a>无缝集成,为处理 JavaScript 项目中的日志记录提供了优雅的解决方案。</p><h2>特性</h2><ul><li>📝 简单灵活的日志接口,支持不同的日志级别</li><li>🔍 支持带占位符的格式化日志消息</li><li>🎯 自动方法日志记录和类日志集成的装饰器</li><li>🔄 与Vue.js类组件无缝集成</li><li>🎛️ 可配置的日志级别和输出器</li><li>🌐 全局和单独的日志记录器管理</li><li>📋 支持浏览器控制台和自定义输出器</li></ul><h2>安装</h2><p>使用 npm 或 yarn 安装该库:</p><pre class="prettyprint source lang-sh"><code>npm install @qubit-ltd/logging
4
4
  </code></pre><p>或</p><pre class="prettyprint source lang-sh"><code>yarn add @qubit-ltd/logging
5
5
  </code></pre><h2>Logger 类</h2><p><code>Logger</code> 类提供了一个简单而灵活的日志记录接口。</p><h3>获取或创建 Logger</h3><p>你可以通过调用静态方法 <code>Logger.getLogger(name, options)</code> 获取一个 <code>Logger</code> 实例,其中:</p><ul><li><code>name</code> 是 logger 的标识符。如果已经存在具有相同名称的 logger,则返回该实例;否则将创建一个新的 logger。</li><li><code>options</code>(可选)是一个对象,可能包括:<ul><li><code>appender: object</code>:指定日志消息的输出目的地。此对象必须实现 <code>trace</code>、<code>debug</code>、<code>info</code>、<code>warn</code> 和 <code>error</code> 方法。 如果省略,将使用 logger 的现有 appender,或者为新创建的 logger 分配默认 appender。</li><li><code>level: string</code>:定义日志记录级别(<code>TRACE</code>、<code>DEBUG</code>、<code>INFO</code>、<code>WARN</code>、<code>ERROR</code>、<code>NONE</code>)。不区分大小写。 如果省略,将使用 logger 的现有日志级别,或者为新创建的 logger 分配默认日志级别。</li></ul></li></ul><p>示例:</p><pre class="prettyprint source lang-javascript"><code>import Logger from '@qubit-ltd/logging';
6
6
 
@@ -241,4 +241,4 @@ yarn test
241
241
 
242
242
  # 构建库
243
243
  yarn build
244
- </code></pre><h2><span id="license">许可证</span></h2><p><a href="https://npmjs.com/package/@qubit-ltd/logging">@qubit-ltd/logging</a> 根据 Apache 2.0 许可证分发。详情请参阅 <a href="LICENSE">LICENSE</a> 文件。</p></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
244
+ </code></pre><h2><span id="license">许可证</span></h2><p><a href="https://npmjs.com/package/@qubit-ltd/logging">@qubit-ltd/logging</a> 根据 Apache 2.0 许可证分发。详情请参阅 <a href="LICENSE">LICENSE</a> 文件。</p></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="关闭搜索"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="搜索..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">输入任何内容查看搜索结果</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title"><a href="index.html" class="sidebar-home-anchor">首页</a></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-类"><div>类</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="Logger.html">Logger</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-全局"><div>全局</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_APPENDER">FACTORY_DEFAULT_APPENDER</a></div><div class="sidebar-section-children"><a href="global.html#FACTORY_DEFAULT_LEVEL">FACTORY_DEFAULT_LEVEL</a></div><div class="sidebar-section-children"><a href="global.html#HasLogger">HasLogger</a></div><div class="sidebar-section-children"><a href="global.html#LOGGING_LEVELS">LOGGING_LEVELS</a></div><div class="sidebar-section-children"><a href="global.html#Log">Log</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button home-button" aria-label="go-to-homepage"><svg><use xlink:href="#home-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script><script>document.addEventListener("DOMContentLoaded",(function(){"undefined"!=typeof tippy&&(tippy(".home-button",{content:"回到首页",delay:500}),tippy(".theme-toggle",{content:"切换主题",delay:500}),tippy(".search-button",{content:"搜索",delay:500}),tippy(".font-size",{content:"更改字体大小",delay:500}))}))</script></body></html>