Skip to content

Commit

Permalink
Merge pull request #1638 from Scille/disable-core-file-logging-in-pac…
Browse files Browse the repository at this point in the history
…kaging

Disable core file logging in packaging
  • Loading branch information
touilleMan committed Feb 23, 2021
2 parents 2c6da86 + 8a0af2c commit d716ae6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions newsfragments/1638.misc.rst
@@ -0,0 +1 @@
Disable logging to file by default when running the GUI client.
7 changes: 4 additions & 3 deletions packaging/macOS/launch_script.py
@@ -1,10 +1,12 @@
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2019 Scille SAS

import parsec.cli
import sys
import os
import locale

from parsec.cli import cli


os.environ["SENTRY_URL"] = "https://863e60bbef39406896d2b7a5dbd491bb@sentry.io/1212848"
os.environ["PREFERRED_ORG_CREATION_BACKEND_ADDR"] = "parsec://saas.parsec.cloud/"

Expand All @@ -16,5 +18,4 @@
# Finder. If not set, Click will report an encoding error and the app won't launch.
locale.setlocale(locale.LC_ALL, "")

sys.argv = [sys.argv[0], "core", "gui", *sys.argv[1:]]
parsec.cli.cli.main()
cli(args=["core", "gui", *sys.argv[1:]])
4 changes: 1 addition & 3 deletions packaging/snap/bin/parsec
@@ -1,8 +1,6 @@
#! /bin/sh

mkdir -p ~/.config/parsec
LOG_FILE=~/.config/parsec/parsec-core.log
echo Starting parsec core >> $LOG_FILE
export XDG_CURRENT_DESKTOP=unknown
PYTHON=${SNAP}/usr/bin/python3

Expand All @@ -22,4 +20,4 @@ export SNAPCRAFT_PART_INSTALL=$SNAP
# (i.e. without sandbox).
unset SNAP

$PYTHON -I -m parsec.cli core gui --log-level=INFO --log-file=$LOG_FILE $@
$PYTHON -I -m parsec.cli core gui $@
4 changes: 1 addition & 3 deletions packaging/win32/parsec-bootstrap.c
Expand Up @@ -26,9 +26,7 @@ int main(int argc, char *argv[])
"os.environ['SENTRY_URL'] = 'https://863e60bbef39406896d2b7a5dbd491bb@sentry.io/1212848'\n"
"os.environ['PREFERRED_ORG_CREATION_BACKEND_ADDR'] = 'parsec://saas.parsec.cloud'\n"
"os.makedirs(os.path.expandvars('%APPDATA%\\\\parsec'), exist_ok=True)\n"
"log_file = os.path.expandvars('%APPDATA%\\\\parsec\\\\parsec-core.log')\n"
"args = ['core', 'gui', '--log-level', 'INFO', '--log-file', log_file, ' '.join(sys.argv[1:])]\n"
"cli(args)\n"
"cli(args=['core', 'gui', *sys.argv[1:]])\n"
);

for (int i = 0; i < argc; i++) {
Expand Down

0 comments on commit d716ae6

Please sign in to comment.