mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
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:
parent
fdb1fe42c6
commit
19e9cd2f7a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user