copy Log.{h,cpp} improvements from dabmux