use assert instead of logging