WINDSOR, Ont. -- A man who whipped his six-year-old son with a charging cord for eating his toast too slowly has been given a conditional discharge, radio station CKLW reported Wednesday.

In sentencing the man from Windsor, Ont., to three years of probation, Ontario court Judge Sharman Bondy said corporal punishment was no answer to loving parenting.

The man, who cannot be named to protect his child's identity, had pleaded guilty to assault with a weapon for the incident that left the boy with welts on his body.

School authorities discovered the welts in December 2015, and the boy's father later admitted to hitting him with a USB charging cord.

Bondy cited the first-time offender's remorse, guilty plea and efforts at rehabilitation, which include taking anger management and parenting courses. The upshot, the judge said, was that jail time was not warranted in this case.

The boy's mother described the father as having a loving and good relationship with his son.

"We are pretty positive that he is moving in the direction of completing his probation and he will complete it properly," his lawyer Patricia Brown, told CKLW. "The conviction will not register -- he receives a discharge -- if he successfully completes probation."

Brown said the family was relieved these "significant dramatic circumstances" had now been dealt with.