(file: str, content: str)
| 369 | |
| 370 | |
| 371 | def _append_log(file: str, content: str) -> None: |
| 372 | path = logger.directory / file |
| 373 | |
| 374 | change_perm = not path.exists() |
| 375 | |
| 376 | try: |
| 377 | with path.open('a') as f: |
| 378 | f.write(content) |
| 379 | |
| 380 | if change_perm: |
| 381 | path.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) |
| 382 | except PermissionError, FileNotFoundError: |
| 383 | # If the file does not exist, ignore the error |
| 384 | pass |
no test coverage detected