added in logging functionality from old logging branch