Skip to content

Commit

Permalink
fixing missing logs by flattening out log folder structure (#116)
Browse files Browse the repository at this point in the history
* fixing missing logs by flattening out log folder structure

* removing superfluous first_log variable
  • Loading branch information
LeStarch authored Feb 17, 2023
1 parent a744b42 commit 0512ff5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/fprime_gds/executables/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,6 @@ class LogDeployParser(ParserBase):
to end up in the proper place.
"""

# Class variable to store logs on first encounter of the logging call. This helps ensure that the logs all end up in
# a consistent directory, opposed to multiple directories across the system.
first_log = None

DESCRIPTION = "Process arguments needed to specify a logging"

def get_arguments(self) -> Dict[Tuple[str, ...], Dict[str, Any]]:
Expand Down Expand Up @@ -340,6 +336,8 @@ def handle_arguments(self, args, **kwargs):
args.logs, datetime.datetime.now().strftime("%Y_%m_%d-%H_%M_%S")
)
)
# A dated directory has been set, all log handling must now be direct
args.log_directly = True

# Make sure directory exists
try:
Expand Down
5 changes: 4 additions & 1 deletion src/fprime_gds/executables/run_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ def launch_html(parsed_args):
Return:
launched process
"""
reproduced_arguments = StandardPipelineParser().reproduce_cli_args(parsed_args)
if "--log-directly" not in reproduced_arguments:
reproduced_arguments += ["--log-directly"]
flask_env = os.environ.copy()
flask_env.update(
{
"FLASK_APP": "fprime_gds.flask.app",
"STANDARD_PIPELINE_ARGUMENTS": "|".join(StandardPipelineParser().reproduce_cli_args(parsed_args)),
"STANDARD_PIPELINE_ARGUMENTS": "|".join(reproduced_arguments),
"SERVE_LOGS": "YES",
}
)
Expand Down

0 comments on commit 0512ff5

Please sign in to comment.