Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable passing a path at startup to specify the location of the logs #160

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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