Example #1
0
def do_init():
    if FIX_UNICODE_OUT:
        fix_unicode_out()
    if not REDIRECT_OUTPUT:
        #figure out if we want to wait for input at the end:
        set_wait_for_input()
        return
    from xpra.platform import get_prgname
    LOG_FILENAME = (get_prgname() or "Xpra")+".log"
    from xpra.platform.win32.paths import _get_data_dir
    d = _get_data_dir()
    log_file = os.path.join(d, LOG_FILENAME)
    sys.stdout = open(log_file, "a")
    sys.stderr = sys.stdout
Example #2
0
def do_init():
    if FIX_UNICODE_OUT:
        fix_unicode_out()
    if not REDIRECT_OUTPUT:
        #figure out if we want to wait for input at the end:
        set_wait_for_input()
        return
    if envbool("XPRA_LOG_TO_FILE", True):
        log_filename = os.environ.get("XPRA_LOG_FILENAME")
        if not log_filename:
            from xpra.platform.win32.paths import _get_data_dir
            from xpra.platform import get_prgname
            data_dir = _get_data_dir(False)
            if not os.path.exists(data_dir):
                os.mkdir(data_dir)
            log_filename = os.path.join(data_dir,
                                        (get_prgname() or "Xpra") + ".log")
        sys.stdout = open(log_filename, "a")
        sys.stderr = sys.stdout