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

func get_format() -> str

Source code
def get_format(level: str) -> str:
    if level == 'DEBUG':
        return debug_format
    else:
        return default_format

func init_log()

Description: 在语言加载完成后执行

Source code
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 u=n(e,[["render",p],["__file","log.html.vue"]]),m=JSON.parse(`{"path":"/en/api/log.html","title":"liteyuki.log","lang":"en-US","frontmatter":{"title":"liteyuki.log","description":"func get_format() -> str Source code func init_log() Description: 在语言加载完成后执行 Source code var debug_format = '{time:YYYY-MM-DD HH:mm:ss} [{level.icon}] <{nam...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://vuepress-theme-hope-docs-demo.netlify.app/api/log.html"}],["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/en/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 Source code func init_log() Description: 在语言加载完成后执行 Source code var debug_format = '{time:YYYY-MM-DD HH:mm:ss} [{level.icon}] <{nam..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["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.58,"words":174},"filePathRelative":"en/api/log.md","autoDesc":true}`);export{u as comp,m as data};