Core: Added the ability to create a debug log of all of the output that is usually sent to stdout. Also relevant merlin.cfg and .gitignore entries.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit 5c9490ad8055fc8df4559e37a381b7cfcba0d333)