(self, level: int, content: str)
| 44 | warn(f'Not enough permission to place log file at {log_file}, creating it in {logger.path} instead') |
| 45 | |
| 46 | def log(self, level: int, content: str) -> None: |
| 47 | self._check_permissions() |
| 48 | |
| 49 | with self.path.open('a') as f: |
| 50 | ts = timestamp() |
| 51 | level_name = logging.getLevelName(level) |
| 52 | f.write(f'[{ts}] - {level_name} - {content}\n') |
| 53 | |
| 54 | def get_content(self, max_bytes: int | None = None) -> bytes: |
| 55 | content = self.path.read_bytes() |
no test coverage detected