Move mako import after log setup