refactor log & logmanager to provide a clean interface