Skip to content

Commit 22e7678

Browse files
authored
Enable passing a path at startup to specify the location of the logs (#160)
2 parents 6d136df + 47c6d40 commit 22e7678

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

openandroidinstaller/openandroidinstaller.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
)
5656
from tooling import run_command
5757

58-
# where to write the logs
59-
logger.add("openandroidinstaller.log")
60-
6158
# VERSION number
6259
VERSION = "0.4.3-beta"
6360

@@ -317,8 +314,19 @@ def close_banner(e):
317314
@click.option(
318315
"--test_config", default="sargo", type=str, help="Config to use for testing"
319316
)
320-
def startup(test: bool, test_config: str):
317+
@click.option(
318+
"-l",
319+
"--logging_path",
320+
type=str,
321+
default=".",
322+
help="Path where to store the log file.",
323+
)
324+
def startup(test: bool, test_config: str, logging_path: str):
321325
"Main entrypoint to the app."
326+
# where to write the logs
327+
logger.add(f"{logging_path}/openandroidinstaller.log")
328+
329+
# start the app
322330
ft.app(
323331
target=functools.partial(main, test=test, test_config=test_config),
324332
assets_dir="assets",

0 commit comments

Comments
 (0)