- Replaced print() with logging.info() and logging.error()
- Added logging configuration to output INFO messages only in TTY
- Ensured ERROR messages are always logged to stdout, including cron runs
- Used sys.stdout.isatty() to detect terminal context
- Maintained existing functionality with updated config and SMTP setup