fix logg() in compile, add more logging to engine.rb when the problem cannot be found