ai-web-summarizer
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
||||
class Config:
|
||||
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Your OpenAI Key is:", Config.OPENAI_API_KEY)
|
||||
@@ -0,0 +1,16 @@
|
||||
import logging
|
||||
|
||||
# Setup logging configuration
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||
handlers=[
|
||||
logging.FileHandler("app.log"),
|
||||
logging.StreamHandler()
|
||||
]
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if __name__ == "__main__":
|
||||
logger.info("Logger is working correctly.")
|
||||
Reference in New Issue
Block a user