make log file destination configurable
Some checks failed
Python Linters / pylint (push) Failing after 57s
Python Linters / formatting (push) Failing after 55s
REUSE Compliance / reuse (push) Successful in 18s
Python Linters / mypy (push) Failing after 11s
Selftests / test-build-install (push) Failing after 9s
Selftests / test-sync (push) Failing after 10s
Some checks failed
Python Linters / pylint (push) Failing after 57s
Python Linters / formatting (push) Failing after 55s
REUSE Compliance / reuse (push) Successful in 18s
Python Linters / mypy (push) Failing after 11s
Selftests / test-build-install (push) Failing after 9s
Selftests / test-sync (push) Failing after 10s
This commit is contained in:
@@ -27,6 +27,12 @@ from ._seafile import (
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
parser.add_argument("-c", "--configdir", required=True, help="The config directory")
|
parser.add_argument("-c", "--configdir", required=True, help="The config directory")
|
||||||
|
parser.add_argument(
|
||||||
|
"-l",
|
||||||
|
"--logfile",
|
||||||
|
required=True,
|
||||||
|
help="The path to the logfile. Default: <configdir>/seafile_mirror.log",
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-d",
|
"-d",
|
||||||
"--dry",
|
"--dry",
|
||||||
@@ -59,6 +65,9 @@ def main(): # pylint: disable=too-many-locals, too-many-statements
|
|||||||
configdir = args.configdir.rstrip("/") + "/"
|
configdir = args.configdir.rstrip("/") + "/"
|
||||||
configfile = configdir + "seafile_mirror.conf.yaml"
|
configfile = configdir + "seafile_mirror.conf.yaml"
|
||||||
cachefile = configdir + ".seafile_mirror.db.json"
|
cachefile = configdir + ".seafile_mirror.db.json"
|
||||||
|
if args.logfile:
|
||||||
|
logfile = args.logfile
|
||||||
|
else:
|
||||||
logfile = configdir + "seafile_mirror.log"
|
logfile = configdir + "seafile_mirror.log"
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
|
|||||||
Reference in New Issue
Block a user