-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Logging System 2.0 #23
Conversation
…as much as possible
Maybe in the dev we should keep the docs/source/, not add in the .gitignore |
utils/logger.py
Outdated
Then you can open ./logs/app.log and view the content. | ||
from utils import BaseLogger | ||
import logging | ||
base_logger = BaseLogger(filename='myapp.log', log_level=logging.DEBUG).logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just call it logger =
import logging | ||
import os | ||
import sys | ||
from typing import Optional | ||
import structlog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove structlog from the pyproject.toml
.. code-block:: python | ||
|
||
#app.log | ||
2024-05-20 22:08:28 - utils.logger - INFO - [hotpotqa.py:81] - question: Were Scott Derrickson and Ed Wood of the same nationality? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to show utils.logger there? not much information
How does the logging system work? | ||
--------------------------------- | ||
|
||
Our logging system, built on Python’s versatile logging module, introduces a ``BaseLogger`` that simplifies logging setup. This ``BaseLogger`` facilitates both console and file outputs, with configurable ``file path``, ``file name`` and ``log level`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even until this point, i only learned one thing: Lightrag log is built on top of default logging module, i have no idea the benefits
Close logging system PR because I combine it with the Document PR, so I can generate doc for it easily. |
TODO: