Add verbose debug option to control detailed debug output level

• Added VERBOSE env var & CLI flag
• Implemented verbose_debug() function
• Added verbose option to splash screen
• Reduced default debug output length
• Modified LLM debug logging behavior
This commit is contained in:
yangdx
2025-02-17 01:38:18 +08:00
parent 9ec920661d
commit 806eadf5dc
6 changed files with 43 additions and 9 deletions

View File

@@ -20,6 +20,23 @@ import tiktoken
from lightrag.prompt import PROMPTS
VERBOSE_DEBUG = False
def verbose_debug(msg: str, *args, **kwargs):
"""Function for outputting detailed debug information.
When VERBOSE_DEBUG=True, outputs the complete message.
When VERBOSE_DEBUG=False, outputs only the first 30 characters.
"""
if VERBOSE_DEBUG:
logger.debug(msg, *args, **kwargs)
def set_verbose_debug(enabled: bool):
"""Enable or disable verbose debug output"""
global VERBOSE_DEBUG
VERBOSE_DEBUG = enabled
class UnlimitedSemaphore:
"""A context manager that allows unlimited access."""