move logging to pkg