diff --git a/tracetools_launch/tracetools_launch/actions/ld_preload.py b/tracetools_launch/tracetools_launch/actions/ld_preload.py index 5a7741d..1aa4d77 100644 --- a/tracetools_launch/tracetools_launch/actions/ld_preload.py +++ b/tracetools_launch/tracetools_launch/actions/ld_preload.py @@ -19,6 +19,7 @@ from typing import List from typing import Optional from typing import Union +from launch import logging from launch.action import Action from launch.actions import SetEnvironmentVariable from launch.launch_context import LaunchContext @@ -43,14 +44,18 @@ class LdPreload(Action): super().__init__(**kwargs) self.__lib_name = lib_name self.__set_env_action = None + self.__logger = logging.get_logger(__name__) # Try to find lib self.__lib_path = self.get_shared_lib_path(self.__lib_name) # And create action if found if self.__lib_path is not None: + self.__logger.debug(f'Shared library found at: {self.__lib_path}') self.__set_env_action = SetEnvironmentVariable( self.ENV_VAR_LD_PRELOAD, self.__lib_path, ) + else: + self.__logger.warn(f'Could not find shared library: {self.__lib_name}') def lib_found(self) -> bool: return self.__set_env_action is not None