Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 15 additions & 5 deletions src/commands/logs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use anyhow::Result;
use clap::ArgMatches;
use clap::{Args, Command, Parser as _, Subcommand};

const BETA_WARNING: &str = "[BETA] The \"logs\" command is in beta. The command is subject \
to breaking changes, including removal, in any Sentry CLI release.";

const LIST_ABOUT: &str = "List logs from your organization";

#[derive(Args)]
Expand All @@ -15,14 +18,19 @@ pub(super) struct LogsArgs {
}

#[derive(Subcommand)]
#[command(about = "Manage logs in Sentry")]
#[command(long_about = "Manage and query logs in Sentry. \
This command provides access to log entries.")]
#[command(about = "[BETA] Manage logs in Sentry")]
#[command(long_about = format!(
"Manage and query logs in Sentry. \
This command provides access to log entries.\n\n\
{BETA_WARNING}")
)]
enum LogsSubcommand {
#[command(about = LIST_ABOUT)]
#[command(about = format!("[BETA] {LIST_ABOUT}"))]
#[command(long_about = format!("{LIST_ABOUT}. \
Query and filter log entries from your Sentry projects. \
Supports filtering by log level and custom queries."))]
Supports filtering by log level and custom queries.\n\n\
{BETA_WARNING}")
)]
List(ListLogsArgs),
}

Expand All @@ -35,6 +43,8 @@ pub(super) fn execute(_: &ArgMatches) -> Result<()> {
unreachable!("expected logs subcommand");
};

eprintln!("{BETA_WARNING}");

match subcommand {
LogsSubcommand::List(args) => list::execute(args),
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/_cases/help/help-windows.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Commands:
info Print information about the configuration and verify authentication.
issues Manage issues in Sentry.
login Authenticate with the Sentry server.
logs Manage logs in Sentry
logs [BETA] Manage logs in Sentry
monitors Manage cron monitors on Sentry.
organizations Manage organizations on Sentry.
projects Manage projects on Sentry.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/_cases/help/help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Commands:
info Print information about the configuration and verify authentication.
issues Manage issues in Sentry.
login Authenticate with the Sentry server.
logs Manage logs in Sentry
logs [BETA] Manage logs in Sentry
monitors Manage cron monitors on Sentry.
organizations Manage organizations on Sentry.
projects Manage projects on Sentry.
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/_cases/logs/logs-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ $ sentry-cli logs --help
? success
Manage and query logs in Sentry. This command provides access to log entries.

[BETA] The "logs" command is in beta. The command is subject to breaking changes, including removal,
in any Sentry CLI release.

Usage: sentry-cli[EXE] logs [OPTIONS] [COMMAND]

Commands:
list List logs from your organization
list [BETA] List logs from your organization
help Print this message or the help of the given subcommand(s)

Options:
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/_cases/logs/logs-list-help.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ $ sentry-cli logs list --help
List logs from your organization. Query and filter log entries from your Sentry projects. Supports
filtering by log level and custom queries.

[BETA] The "logs" command is in beta. The command is subject to breaking changes, including removal,
in any Sentry CLI release.

Usage: sentry-cli[EXE] logs list [OPTIONS]

Options:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
```
$ sentry-cli logs list --org wat-org --project 12345
? success
[BETA] The "logs" command is in beta. The command is subject to breaking changes, including removal, in any Sentry CLI release.
No logs found

```
1 change: 1 addition & 0 deletions tests/integration/_cases/logs/logs-list-with-data.trycmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
```
$ sentry-cli logs list
? success
[BETA] The "logs" command is in beta. The command is subject to breaking changes, including removal, in any Sentry CLI release.
+------------------+---------------------------+----------+--------------------------+----------------------+
| Item ID | Timestamp | Severity | Message | Trace |
+------------------+---------------------------+----------+--------------------------+----------------------+
Expand Down