analyse debugstate only once in logfile.php
code clean up