added new routine print_log in sam_modules; sam_modules is used in other files;