diff --git a/samcli/lib/providers/sam_function_provider.py b/samcli/lib/providers/sam_function_provider.py index 0a1a220980..ea92504635 100644 --- a/samcli/lib/providers/sam_function_provider.py +++ b/samcli/lib/providers/sam_function_provider.py @@ -97,16 +97,15 @@ def get(self, name: str) -> Optional[Function]: if len(found_fs) > 1: found_fs.sort(key=lambda f0: f0.full_path.lower()) - LOG.warning( - "Multiple functions found with keyword %s! Function %s will be invoked! " - "If it's not the function you are going to invoke," - "please choose one of them from below:", - name, - found_fs[0].full_path, + message = ( + f"Multiple functions found with keyword {name}! Function {found_fs[0].full_path} will be " + f"invoked! If it's not the function you are going to invoke, please choose one of them from" + f" below:" ) + LOG.warning(Colored().yellow(message)) for found_f in found_fs: - LOG.warning(found_f.full_path) + LOG.warning(Colored().yellow(found_f.full_path)) resolved_function = found_fs[0]