SSujitX / google-news-url-decoder

A Python script to decode Google News article URLs.
MIT License
56 stars 3 forks source link

Request to Remove setup_logging() Function or Modify Logging Setup with a read-only file system #9

Open sunilthakan opened 2 weeks ago

sunilthakan commented 2 weeks ago

The recent changes in the googlenewsdecoder library introduced a setup_logging() function in new_decoderv1 that configures logging to write to a file (e.g., google_news_new_decoderv1.log). This change causes issues in environments with a read-only file system. Removing or modifying the file-based logging setup will improve compatibility and prevent runtime errors in environments with restricted file access, making the library more versatile.

SSujitX commented 2 weeks ago

The recent changes in the googlenewsdecoder library introduced a setup_logging() function in new_decoderv1 that configures logging to write to a file (e.g., google_news_new_decoderv1.log). This change causes issues in environments with a read-only file system. Removing or modifying the file-based logging setup will improve compatibility and prevent runtime errors in environments with restricted file access, making the library more versatile.

okay in next updates.

L-ENA commented 1 week ago

I ran into this issue when using your super helpful and amazing library on a Streamlit app. For me it helped to simply remove the logging.FileHandler(log_file) from the handlers list in the setup_logging function. It now only contains the logging.StreamHandler() which is fine for my purposes. Thanks for looking into this!


    logging.basicConfig(
        level=logging.ERROR,
        format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
        handlers=[logging.StreamHandler()],#removing logging.FileHandler(log_file) from the handlers list

    )