allow specifying log path in eden debug log

Summary: Adds an option to print the path to the eden log file. Similar to `eden pid`, this can be used for shell one-liners.

Reviewed By: chadaustin

Differential Revision: D30558294

fbshipit-source-id: ca70addaef2093e10f0321bae0cff3b1bfc7dc75
This commit is contained in:
Genevieve Helsel 2021-08-30 14:14:54 -07:00 committed by Facebook GitHub Bot
parent fdb1fe42c6
commit 19e9cd2f7a

View File

@ -924,6 +924,11 @@ class LogCmd(Subcmd):
"Size is ignored if --full is set. Defaults to 1M. Works with --upload and --stdout"
),
)
parser.add_argument(
"--path",
action="store_true",
help="Print the location of the EdenFS log file",
)
def upload_logs(
self, args: argparse.Namespace, instance: EdenInstance, eden_log_path: Path
@ -956,6 +961,10 @@ class LogCmd(Subcmd):
print(f"No log file found at {eden_log_path}", file=sys.stderr)
return 1
if args.path:
print(eden_log_path, file=sys.stdout)
return 0
if args.stdout or args.upload:
return self.upload_logs(args, instance, eden_log_path)
else: