Skip to content

Commit

Permalink
chore: put date in log file name
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 28, 2024
1 parent cb881f6 commit 02bc938
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/llmling/core/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from datetime import datetime
import logging
import sys
from typing import TYPE_CHECKING, Literal
Expand All @@ -13,10 +14,10 @@
if TYPE_CHECKING:
from collections.abc import Sequence


# Get platform-specific log directory
LOG_DIR = UPath(platformdirs.user_log_dir("llmling", "llmling"))
LOG_FILE = LOG_DIR / "llmling.log"
# Include date in log filename for parallel runs
LOG_FILE = LOG_DIR / f"llmling_{datetime.now():%Y-%m-%d_%H-%M-%S}.log"

# Maximum log file size in bytes (10MB)
MAX_LOG_SIZE = 10 * 1024 * 1024
Expand Down

0 comments on commit 02bc938

Please sign in to comment.