Better logging, support for custom compile function