unify log util
start agent refactoring