Finish implementation of log marking (not tested yet)