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

Add logs command #5007

Merged
merged 1 commit into from
May 20, 2023
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
18 changes: 18 additions & 0 deletions langchain/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,19 @@ def stop(self) -> None:
]
)

def logs(self) -> None:
"""Print the logs from the LangChainPlus server."""
subprocess.run(
[
*self.docker_compose_command,
"-f",
str(self.docker_compose_file),
"-f",
str(self.ngrok_path),
"logs",
]
)


def env() -> None:
"""Print the runtime environment information."""
Expand Down Expand Up @@ -248,6 +261,11 @@ def main() -> None:
)
server_stop_parser.set_defaults(func=lambda args: server_command.stop())

server_logs_parser = server_subparsers.add_parser(
"logs", description="Show the LangChainPlus server logs."
)
server_logs_parser.set_defaults(func=lambda args: server_command.logs())

env_parser = subparsers.add_parser("env")
env_parser.set_defaults(func=lambda args: env())

Expand Down