Create logging / tracing function in MWParserEnvironment.

* Based on logType parameter, prints out errors / warnings or
generates tracing / debugging output.
* When logType is "error" or "warning", prints out wiki page &
revision ID where error occurred, as well as an error message.
* When logType is "trace pre/html/dsr", generates tracing output
depending on which command-line tracing flags have been set.
* When logType is "debug", generates debugging output if the
command-line --debug flag is set.

Change-Id: I9265400f8e21952bda233eec86f0971cbd2f61a9