adding logging function (beta)