Added an optional detail argument to add more info to the message

This is very useful when logging exceptions