From 337d80c84735413ef87b12f46e65ed4e31073375 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Sat, 7 Mar 2020 13:56:13 -0500 Subject: [PATCH] Add logs for LdPreload action on success or failure Signed-off-by: Christophe Bedard --- tracetools_launch/tracetools_launch/actions/ld_preload.py | 5 +++++ 1 file changed, 5 insertions(+) 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