Skip to content

Commit

Permalink
Remove unused method.
Browse files Browse the repository at this point in the history
This is now handled by the `LoggerRegistry`.
  • Loading branch information
ioannis-vm committed Oct 31, 2024
1 parent b51d532 commit 8921ac4
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions pelicun/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,38 +496,6 @@ def print_system_info(self) -> None:
prepend_timestamp=False,
)

def log_exception(
self,
exc_type: type[BaseException],
exc_value: BaseException,
exc_traceback: TracebackType | None,
) -> None:
"""
Log uncaught exceptions and their traceback.
Parameters
----------
exc_type : Type[BaseException]
The exception class.
exc_value : BaseException
The exception instance.
exc_traceback : Optional[TracebackType]
The traceback object representing the call stack at the point
where the exception occurred.
"""
message = (
f"Unhandled exception occurred:\n"
f"{''.join(traceback.format_exception(exc_type, exc_value, exc_traceback))}"
)

if self.log_file is not None:
with Path(self.log_file).open('a', encoding='utf-8') as f:
f.write(message)

if self.print_log:
print(message, file=sys.stderr) # noqa: T201


# get the absolute path of the pelicun directory
pelicun_path = Path(__file__).resolve().parent
Expand Down

0 comments on commit 8921ac4

Please sign in to comment.