append logging and clear logging in main loop
This commit is contained in:
@@ -381,6 +381,10 @@ def main():
|
|||||||
|
|
||||||
# Fetch feeds
|
# Fetch feeds
|
||||||
if not args.no_fetch:
|
if not args.no_fetch:
|
||||||
|
# Clear log file before starting a new fetch cycle
|
||||||
|
log_file = Path(__file__).resolve().parent / "news_digest.log"
|
||||||
|
log_file.write_text("")
|
||||||
|
|
||||||
feeds = config.get("feeds", [])
|
feeds = config.get("feeds", [])
|
||||||
total_new = 0
|
total_new = 0
|
||||||
|
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
LOG_FILE="$SCRIPT_DIR/news_digest.log"
|
LOG_FILE="$SCRIPT_DIR/news_digest.log"
|
||||||
uv run --python 3.12 --with-requirements "$SCRIPT_DIR/requirements.txt" "$SCRIPT_DIR/main.py" -v "$@" 2>"$LOG_FILE"
|
uv run --python 3.12 --with-requirements "$SCRIPT_DIR/requirements.txt" "$SCRIPT_DIR/main.py" -v "$@" 2>>"$LOG_FILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user