Skip to content
Snippets Groups Projects
Commit 3398ad1e authored by Max Drexler's avatar Max Drexler
Browse files

Cap rotating logs to ~1GB

parent f8887f65
No related branches found
No related tags found
No related merge requests found
......@@ -63,8 +63,8 @@ def initialize_logging(verbosity: int, rotating_dir: str | None = None) -> None:
)
if rotating_dir is not None:
file_handler = logging.handlers.TimedRotatingFileHandler(
os.path.join(rotating_dir, LOG_NAME), when="D", utc=True
file_handler = logging.handlers.RotatingFileHandler(
os.path.join(rotating_dir, LOG_NAME), encoding='utf-8', backupCount=5, maxBytes= 150 * 1024
)
file_handler.setFormatter(log_formatter)
file_handler.setLevel(logging.DEBUG)
......@@ -103,7 +103,6 @@ def setup() -> tuple[Iterable[GribPayload], Callable[[GribPayload], None]]:
default=None,
help="Set up a rotating file logger in this directory.",
)
parser.add_argument(
"-R",
"--realtime",
......@@ -116,7 +115,6 @@ def setup() -> tuple[Iterable[GribPayload], Callable[[GribPayload], None]]:
action="store_true",
help="When using a directory as the source, process all files in the directory recursively instead of setting up a watch.",
)
parser.add_argument(
"-o",
"--output",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment