in cost-optimization/hpa-config-recommender/src/hpaconfigrecommender/utils/models.py [0:0]
def add_log(self, message: str, *args):
"""
Adds a log message with optional interpolation.
Args:
message (str): The log message template with placeholders.
*args: Values to be formatted into the message. Tuples and other
non-string types are converted to strings automatically.
"""
# Convert non-string args (like tuple) to string
args = tuple(str(arg) for arg in args)
# Interpolate message with args if provided
if args:
message = message % args
# Append the formatted message to the logs
self.logs.append(message)