Reimplemented QsLog, and fix so it works inside a plugin now