If you expect a lot of this messages, for performance reasons is better to do:

```python
format_str = "task_id '%s': already locked.  Contains value '%s'"
TASK_LOG.warning(format_str, task_id, value_of_key)
```