Substituted print with logging messages on script file