Avoid crashes in the log section when file is too large

Many modules are compatible only with certain ROMs and produce many errors
on other ROMs. This results in a large log file. Don't load the full log
file in such cases to give users an easy chance to identify the
incompatible module and disable it.
Added option to clear debugging logs

Mainly based on pull request #71, with some modifications by rovo89.