Add logging
This commit is contained in:
10
main.py
10
main.py
@@ -14,6 +14,7 @@ Usage:
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
@@ -53,6 +54,15 @@ def extract_content(url: str, source_type: str) -> dict:
|
||||
|
||||
|
||||
def main():
|
||||
logging.basicConfig(
|
||||
level=getattr(logging, Config.LOG_LEVEL.upper(), logging.INFO),
|
||||
format="%(asctime)s %(levelname)s [%(name)s] %(message)s",
|
||||
handlers=[
|
||||
logging.StreamHandler(),
|
||||
logging.FileHandler(Config.LOG_FILE),
|
||||
],
|
||||
)
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Extract content from URLs and save to Obsidian notes"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user