llama_index
llama_index copied to clipboard
"force" logging configuration is required because logging.basicConfig is written in github_repository_reader.py
The following code does not reflect the logging settings.
from llama_index import GPTSimpleVectorIndex
from llama_index.readers.base import BaseReader
from llama_index.readers.schema.base import Document
...
if __name__ == "__main__":
logging.basicConfig(stream=sys.stdout, format="%(asctime)s %(message)s", level=logging.DEBUG)
logger.debug("test")
It can be solved by adding force parameter as the following code:
logging.basicConfig(stream=sys.stdout, format="%(asctime)s %(message)s", level=logging.DEBUG, force=True)
I think the cause of the problem is that logging.basicConfig is written in github_repository_reader.py.
https://github.com/jerryjliu/llama_index/blob/41ccffe0bbf794fa884d5994f18d9fc8c30445c6/gpt_index/readers/github_readers/github_repository_reader.py#L33