move printlog from makelibrary to Subfunctions