Moved debug log to an upper level