Rework the log system

done.