import{_ as n,o as s,c as a,e as t}from"./app-BrSLFMno.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),p=[o];function l(c,i){return s(),a("div",null,p)}const u=n(e,[["render",l],["__file","log.html.vue"]]),m=JSON.parse(`{"path":"/en/dev/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/dev/api/log.html"}],["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/en/dev/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"}],["meta",{"property":"og:updated_time","content":"2024-08-29T06:19:39.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-29T06:19:39.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.log\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-29T06:19:39.000Z\\",\\"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":1724234361000,"updatedTime":1724912379000,"contributors":[{"name":"snowy","email":"snowykami@outlook.com","commits":2}]},"readingTime":{"minutes":0.58,"words":174},"filePathRelative":"en/dev/api/log.md","localizedDate":"August 21, 2024","autoDesc":true}`);export{u as comp,m as data};