service
dev_tool.services.stacktrace.service
StacktraceService
A thread-safe singleton service for storing stacktraces from a session.
This class provides centralized stacktrace storage with support for adding, retrieving, and clearing stacktraces.
The constructor for the StacktraceService class.
Initializes the service with an empty stacktrace list.
Source code in dev_tool/services/stacktrace/service.py
__new__
A class method that creates a singleton instance with thread safety.
Returns:
-
Self–The singleton StacktraceService instance.
Source code in dev_tool/services/stacktrace/service.py
add
A method that adds a stacktrace to the storage.
Parameters:
-
content(str) –The stacktrace content.
-
message(str) –The error message associated with the stacktrace.
Source code in dev_tool/services/stacktrace/service.py
clear
get
A method that gets a stacktrace by index.
Parameters:
-
index(int) –The index of the stacktrace.
Returns:
-
StacktraceEntry | None–The stacktrace entry, or None if not found.
Source code in dev_tool/services/stacktrace/service.py
get_all
A method that gets all stored stacktraces.
Returns:
-
list[StacktraceEntry]–A list of all stacktrace entries.
get_count
A method that gets the number of stored stacktraces.
Returns:
-
int–The number of stored stacktraces.
get_latest
A method that gets the most recent stacktrace.
Returns:
-
StacktraceEntry | None–The most recent stacktrace entry, or None if empty.