import{_ as n,o as s,c as a,d as t}from"./app-EhCe7g9m.js";const e={},o=t(`

func get_format() -> str

源代码
def get_format(level: str) -> str:
    if level == 'DEBUG':
        return debug_format
    else:
        return default_format

func init_log()

说明: 在语言加载完成后执行

源代码
def init_log(config: dict):
    """
    在语言加载完成后执行
    Returns:

    """
    logger.remove()
    logger.add(sys.stdout, level=0, diagnose=False, format=get_format(config.get('log_level', 'INFO')))
    show_icon = config.get('log_icon', True)
    logger.level('DEBUG', color='<blue>', icon=f"{('🐛' if show_icon else '')}DEBUG")
    logger.level('INFO', color='<normal>', icon=f"{('ℹ️' if show_icon else '')}INFO")
    logger.level('SUCCESS', color='<green>', icon=f"{('✅' if show_icon else '')}SUCCESS")
    logger.level('WARNING', color='<yellow>', icon=f"{('⚠️' if show_icon else '')}WARNING")
    logger.level('ERROR', color='<red>', icon=f"{('⭕' if show_icon else '')}ERROR")

var debug_format = '<c>{time:YYYY-MM-DD HH:mm:ss}</c> <lvl>[{level.icon}]</lvl> <c><{name}.{module}.{function}:{line}></c> {message}'

var default_format = '<c>{time:MM-DD HH:mm:ss}</c> <lvl>[{level.icon}]</lvl> <c><{name}></c> {message}'

`,9),l=[o];function p(c,i){return s(),a("div",null,l)}const r=n(e,[["render",p],["__file","log.html.vue"]]),m=JSON.parse(`{"path":"/api/log.html","title":"liteyuki.log","lang":"zh-CN","frontmatter":{"title":"liteyuki.log","description":"func get_format() -> str 源代码 func init_log() 说明: 在语言加载完成后执行 源代码 var debug_format = '{time:YYYY-MM-DD HH:mm:ss} [{level.icon}] <{name}.{module}.{function}:{l...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://vuepress-theme-hope-docs-demo.netlify.app/en/api/log.html"}],["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/api/log.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot 轻雪机器人"}],["meta",{"property":"og:title","content":"liteyuki.log"}],["meta",{"property":"og:description","content":"func get_format() -> str 源代码 func init_log() 说明: 在语言加载完成后执行 源代码 var debug_format = '{time:YYYY-MM-DD HH:mm:ss} [{level.icon}] <{name}.{module}.{function}:{l..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.log\\",\\"image\\":[\\"\\"],\\"dateModified\\":null,\\"author\\":[]}"]]},"headers":[{"level":3,"title":"func get_format() -> str","slug":"func-get-format-str","link":"#func-get-format-str","children":[]},{"level":3,"title":"func init_log()","slug":"func-init-log","link":"#func-init-log","children":[]},{"level":3,"title":"var debug_format = '{time:YYYY-MM-DD HH:mm:ss} [{level.icon}] <{name}.{module}.{function}:{line}> {message}'","slug":"var-debug-format-c-time-yyyy-mm-dd-hh-mm-ss-c-lvl-level-icon-lvl-c-name-module-function-line-c-message","link":"#var-debug-format-c-time-yyyy-mm-dd-hh-mm-ss-c-lvl-level-icon-lvl-c-name-module-function-line-c-message","children":[]},{"level":3,"title":"var default_format = '{time:MM-DD HH:mm:ss} [{level.icon}] <{name}> {message}'","slug":"var-default-format-c-time-mm-dd-hh-mm-ss-c-lvl-level-icon-lvl-c-name-c-message","link":"#var-default-format-c-time-mm-dd-hh-mm-ss-c-lvl-level-icon-lvl-c-name-c-message","children":[]}],"git":{"createdTime":null,"updatedTime":null,"contributors":[]},"readingTime":{"minutes":0.6,"words":179},"filePathRelative":"api/log.md","autoDesc":true}`);export{r as comp,m as data};