1234567891011121314 |
- from pathlib import Path
- from loguru import logger
- _absolute = Path(__file__).absolute().parent.parent
- _log_path = (_absolute / 'logs/crawl_{time:YYYYMMDD}.log').resolve()
- logger.add(
- _log_path,
- format='{time:YYYY-MM-DD HH:mm:ss} - {level} - {message}',
- level='INFO',
- rotation='00:00',
- retention='1 week',
- encoding='utf-8',
- )
|