INNER CODE UNIT · Python

get_log_file_path

karanb192/claude-code-hooks · utils/event-logger.py:38

def get_log_file_path():
    log_dir = Path.home() / ".claude" / "hooks-logs"
    log_dir.mkdir(parents=True, exist_ok=True)
    return log_dir / f"{datetime.now().strftime('%Y-%m-%d')}.jsonl"


def truncate(value, max_len=2000):
    if isinstance(value, str) and len(value) > max_len:
        return f"{value[:max_len]}... ({len(value)} chars)"
    return value


def process(value, max_str=2000, max_list=50):
    if value is None or isinstance(value, bool):
        return value
    if isinstance(value, str):
        return truncate(value, max_str)
    if isinstance(value, (int, float)):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…