init_logger.py 799 Bytes
Newer Older
Weizhi Cui's avatar
Weizhi Cui committed
1 2 3 4 5 6 7 8 9
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version     : Python 3.11.4
# @Software    : Sublime Text 4
# @Author      : StudentCWZ
# @Email       : StudentCWZ@outlook.com
# @Date        : 2023/10/28 18:16
# @File        : init_logger.py
崔为之's avatar
崔为之 committed
10
# @Description : Initializes the FlaskLoguru service for a Flask application.
Weizhi Cui's avatar
Weizhi Cui committed
11 12 13
"""

from flask import Flask
崔为之's avatar
崔为之 committed
14
from application.libs import FlaskLoguru
Weizhi Cui's avatar
Weizhi Cui committed
15 16 17 18


def init_logger(app: Flask) -> None:
    """
崔为之's avatar
崔为之 committed
19 20 21 22 23 24 25 26
    Initializes the FlaskLoguru service for a Flask application.

    Loguru is a library which aims to bring enjoyable logging in Python.
    It provides a nice and clean interface over logging's complex API
    to ease the process of logging.

    Args:
        app (Flask): The Flask application.
Weizhi Cui's avatar
Weizhi Cui committed
27

崔为之's avatar
崔为之 committed
28 29
    Returns:
        None
Weizhi Cui's avatar
Weizhi Cui committed
30 31
    """
    FlaskLoguru(app)