Skip to content

Commit 654e0ec

Browse files
committed
Switch to BaseServer.start_debug and BaseServer.stop_debug
1 parent ba09401 commit 654e0ec

File tree

2 files changed

+24
-47
lines changed

2 files changed

+24
-47
lines changed

src/ansys/dpf/core/debug.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/ansys/dpf/core/server_types.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
from ansys.dpf.core._version import min_server_version, server_to_ansys_version
5252
from ansys.dpf.core.check_version import get_server_version, meets_version, version_requires
5353
from ansys.dpf.core.server_context import AvailableServerContexts, ServerContext
54-
from ansys.dpf.gate import data_processing_grpcapi, load_api
54+
from ansys.dpf.gate import data_processing_capi, data_processing_grpcapi, load_api
5555

5656
if TYPE_CHECKING: # pragma: no cover
5757
from ansys.dpf.core.server_factory import DockerConfig
@@ -709,6 +709,29 @@ def __del__(self):
709709
except:
710710
warnings.warn(traceback.format_exc())
711711

712+
def start_debug(self, folder_path: str | Path):
713+
"""Start writing server debug information within the given folder.
714+
715+
Parameters
716+
----------
717+
folder_path:
718+
Path to a folder where to write server debug info.
719+
720+
"""
721+
api = self.get_api_for_type(
722+
capi=data_processing_capi.DataProcessingCAPI,
723+
grpcapi=data_processing_grpcapi.DataProcessingGRPCAPI,
724+
)
725+
api.data_processing_set_debug_trace(text=str(folder_path))
726+
727+
def stop_debug(self):
728+
"""Stop writing server debug information."""
729+
api = self.get_api_for_type(
730+
capi=data_processing_capi.DataProcessingCAPI,
731+
grpcapi=data_processing_grpcapi.DataProcessingGRPCAPI,
732+
)
733+
api.data_processing_set_debug_trace(text="")
734+
712735

713736
class CServer(BaseServer, ABC):
714737
"""Abstract class for servers going through the DPFClientAPI."""

0 commit comments

Comments
 (0)