MDL-46881 core_task: Add a logging trait