refactored tracelog