add flag nail_stdout to specify if need to print to stdout (default true)