(window.webpackJsonp=window.webpackJsonp||[]).push([[111],{568:function(e,t,r){"use strict";r.r(t);var s=r(21),a=Object(s.a)({},(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"nonebot-log-模块"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nonebot-log-模块"}},[e._v("#")]),e._v(" NoneBot.log 模块")]),e._v(" "),r("h2",{attrs:{id:"日志"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#日志"}},[e._v("#")]),e._v(" 日志")]),e._v(" "),r("p",[e._v("NoneBot 使用 "),r("a",{attrs:{href:"https://github.com/Delgan/loguru",target:"_blank",rel:"noopener noreferrer"}},[e._v("loguru"),r("OutboundLink")],1),e._v(" 来记录日志信息。")]),e._v(" "),r("p",[e._v("自定义 logger 请参考 "),r("a",{attrs:{href:"https://github.com/Delgan/loguru",target:"_blank",rel:"noopener noreferrer"}},[e._v("loguru"),r("OutboundLink")],1),e._v(" 文档。")]),e._v(" "),r("h2",{attrs:{id:"logger"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#logger"}},[e._v("#")]),e._v(" "),r("code",[e._v("logger")])]),e._v(" "),r("ul",[r("li",[r("p",[r("strong",[e._v("说明")])]),e._v(" "),r("p",[e._v("NoneBot 日志记录器对象。")])]),e._v(" "),r("li",[r("p",[r("strong",[e._v("默认信息")])]),e._v(" "),r("ul",[r("li",[r("p",[e._v("格式: "),r("code",[e._v("[%(asctime)s %(name)s] %(levelname)s: %(message)s")])])]),e._v(" "),r("li",[r("p",[e._v("等级: "),r("code",[e._v("DEBUG")]),e._v(" / "),r("code",[e._v("INFO")]),e._v(" ，根据 config 配置改变")])]),e._v(" "),r("li",[r("p",[e._v("输出: 输出至 stdout")])])])]),e._v(" "),r("li",[r("p",[r("strong",[e._v("用法")])])])]),e._v(" "),r("div",{staticClass:"language-python line-numbers-mode"},[r("pre",{pre:!0,attrs:{class:"language-python"}},[r("code",[r("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("from")]),e._v(" nonebot"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("log "),r("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("import")]),e._v(" logger\n")])]),e._v(" "),r("div",{staticClass:"line-numbers-wrapper"},[r("span",{staticClass:"line-number"},[e._v("1")]),r("br")])]),r("h2",{attrs:{id:"class-loguruhandler"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#class-loguruhandler"}},[e._v("#")]),e._v(" "),r("em",[e._v("class")]),e._v(" "),r("code",[e._v("LoguruHandler")])]),e._v(" "),r("p",[e._v("基类："),r("code",[e._v("logging.Handler")])]),e._v(" "),r("h3",{attrs:{id:"emit-record"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#emit-record"}},[e._v("#")]),e._v(" "),r("code",[e._v("emit(record)")])]),e._v(" "),r("p",[e._v("Do whatever it takes to actually log the specified logging record.")]),e._v(" "),r("p",[e._v("This version is intended to be implemented by subclasses and so\nraises a NotImplementedError.")])])}),[],!1,null,null,null);t.default=a.exports}}]);