mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-23 17:36:28 +00:00
* Fixed all clippy warnings. * Added `clippy` to CI. * Reverted an unwanted change + Applied `cargo fmt`. * Fixed the idiom version. * Revert "Fixed the idiom version." This reverts commit6f78be0d42. * Fixed clippy issues on CI. * Revert "Fixed clippy issues on CI." This reverts commita9fa6ba189. * Revert "Reverted an unwanted change + Applied `cargo fmt`." This reverts commit6bd37b6479. * Revert "Fixed all clippy warnings." This reverts commitd1f3b847e3. * Removed Clippy * Removed Lint * `admin.rs` clippy fixes. * Applied more clippy changes. * Even more clippy changes. * `client.rs` clippy fixes. * `server.rs` clippy fixes. * Revert "Removed Lint" This reverts commitcb5042b144. * Revert "Removed Clippy" This reverts commit6dec8bffb1. * Applied lint. * Revert "Revert "Fixed clippy issues on CI."" This reverts commit49164a733c.
37 lines
796 B
Rust
37 lines
796 B
Rust
use clap::{Parser, ValueEnum};
|
|
use tracing::Level;
|
|
|
|
/// PgCat: Nextgen PostgreSQL Pooler
|
|
#[derive(Parser, Debug)]
|
|
#[command(author, version, about, long_about = None)]
|
|
pub struct Args {
|
|
#[arg(default_value_t = String::from("pgcat.toml"), env)]
|
|
pub config_file: String,
|
|
|
|
#[arg(short, long, default_value_t = tracing::Level::INFO, env)]
|
|
pub log_level: Level,
|
|
|
|
#[clap(short='F', long, value_enum, default_value_t=LogFormat::Text, env)]
|
|
pub log_format: LogFormat,
|
|
|
|
#[arg(
|
|
short,
|
|
long,
|
|
default_value_t = false,
|
|
env,
|
|
help = "disable colors in the log output"
|
|
)]
|
|
pub no_color: bool,
|
|
}
|
|
|
|
pub fn parse() -> Args {
|
|
Args::parse()
|
|
}
|
|
|
|
#[derive(ValueEnum, Clone, Debug)]
|
|
pub enum LogFormat {
|
|
Text,
|
|
Structured,
|
|
Debug,
|
|
}
|