Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions brainrender/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
from loguru import logger
from pathlib import Path
from rich.logging import RichHandler
Expand Down Expand Up @@ -37,10 +36,8 @@ def set_logging(level="INFO", path=None):
"""
logger.remove()

path = path or str(base_dir / "log.log")
if Path(path).exists():
Path(path).unlink()
logger.add(path, level="DEBUG")
path = path or str(base_dir / "brainrender_{time}.log")
logger.add(path, retention=settings.NUM_LOGS_KEPT, level="DEBUG")

if level == "DEBUG":
logger.configure(
Expand Down
1 change: 1 addition & 0 deletions brainrender/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@
SHOW_AXES = True
WHOLE_SCREEN = False # If true render window is full screen
OFFSCREEN = False
NUM_LOGS_KEPT = 100
Loading