def setWriteToTrailer(flag=False):
    """Set the flag to indicate whether we should write to trailer files.

    flag: boolean
        Value to assign to the variable write_to_trailer (global to this
        file); if True, the printMsg function will write to the trailer
        file, in addition to the standard output
    """
    global write_to_trailer
    write_to_trailer = flag
