Skip to content

Commit

Permalink
Enable passing a path at startup to specify the location of the logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak committed May 16, 2023
1 parent 6d136df commit 47c6d40
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions openandroidinstaller/openandroidinstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
)
from tooling import run_command

# where to write the logs
logger.add("openandroidinstaller.log")

# VERSION number
VERSION = "0.4.3-beta"

Expand Down Expand Up @@ -317,8 +314,19 @@ def close_banner(e):
@click.option(
"--test_config", default="sargo", type=str, help="Config to use for testing"
)
def startup(test: bool, test_config: str):
@click.option(
"-l",
"--logging_path",
type=str,
default=".",
help="Path where to store the log file.",
)
def startup(test: bool, test_config: str, logging_path: str):
"Main entrypoint to the app."
# where to write the logs
logger.add(f"{logging_path}/openandroidinstaller.log")

# start the app
ft.app(
target=functools.partial(main, test=test, test_config=test_config),
assets_dir="assets",
Expand Down

0 comments on commit 47c6d40

Please sign in to comment.