Log via logging code instead of printing messages