diff --git a/pyproject.toml b/pyproject.toml index 412c62b..e50e77a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "kshift" -version = "1.0.0" +version = "1.0.1" authors = [ { name="Seth Mackert", email="seth.mackert@fastsycamore.com" }, ] diff --git a/src/kshift/main.py b/src/kshift/main.py index 92de144..578161d 100755 --- a/src/kshift/main.py +++ b/src/kshift/main.py @@ -30,15 +30,16 @@ cache_dir = log_file.parent cache_dir.mkdir(parents=True, exist_ok=True) -logging.basicConfig(filename=log_file, - level=logging.INFO, - format="%(asctime)s - %(levelname)s - %(message)s", - datefmt="%Y-%m-%d %H:%M:%S") - -handler = RotatingFileHandler("theme_changes.log", +# Setup RotatingFileHandler for the same file +handler = RotatingFileHandler(log_file, maxBytes=1 * 1024 * 1024, backupCount=1) -logging.getLogger().addHandler(handler) +formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s", + datefmt="%Y-%m-%d %H:%M:%S") +handler.setFormatter(formatter) + +# Configure logging +logging.basicConfig(level=logging.INFO, handlers=[handler]) def log_theme_change(theme_name):