“But he has not dealt with this situation well. I cannot couch that in any other terms.

“This entire matter has been reopened by his own actions. If he had knuckled down and done everything that was asked of him, he would never have seen the inside of this court again.

“But I would submit that you may, just, be able to give him a final opportunity to show he can effectively deal with his problems.”

Sheriff Pender told Logan: “You were well aware this sentence was a direct alternative to custody, and you have not complied.

“However, I’m going to give you one final chance to deal with this properly.

“But I warn you now: if you do not comply with it to the letter, you’re going to jail.”

Logan was handed a further three-month curfew and told to come back to court on July 31 for a review.