mirror of
https://github.com/lexmount/moli.git
synced 2026-10-03 00:00:44 +00:00
refactor(cli): remove unused log format flag
This commit is contained in:
@@ -216,7 +216,7 @@ evaluation environments, and reinforcement-learning workloads.
|
||||
screenshots, and low-frequency CPU-rendered DevTools screencast frames.
|
||||
- **Controllable operational options** — profiles, cookies, HTTP cache, proxies,
|
||||
resource families, connection limits, timeouts, private-network policy,
|
||||
user-agent overrides, structured logging, and network diagnostics are all
|
||||
user-agent overrides, diagnostic logging, and network diagnostics are all
|
||||
available.
|
||||
|
||||
## Moli's relationship with Lexmount
|
||||
|
||||
@@ -272,8 +272,6 @@ async def start_moli(binary: Path, *, max_connections: int) -> BrowserProcess:
|
||||
cache_dir,
|
||||
"--log-level",
|
||||
"info",
|
||||
"--log-format",
|
||||
"logfmt",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -465,9 +465,6 @@ pub struct CommonArgs {
|
||||
#[arg(short = 'L', long, value_enum)]
|
||||
pub log_level: Option<LogLevel>,
|
||||
|
||||
#[arg(long, value_enum)]
|
||||
pub log_format: Option<LogFormat>,
|
||||
|
||||
#[arg(long, num_args = 0..=1, default_missing_value = "")]
|
||||
pub log_filter_scopes: Option<String>,
|
||||
|
||||
@@ -535,13 +532,6 @@ impl LogLevel {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
|
||||
#[value(rename_all = "snake_case")]
|
||||
pub enum LogFormat {
|
||||
Pretty,
|
||||
Logfmt,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
|
||||
#[value(rename_all = "snake_case")]
|
||||
pub enum DumpFormat {
|
||||
|
||||
+1
-5
@@ -10,9 +10,7 @@ use moli_fetch::{FetchConfig, WebBotAuthProfile, WebBotAuthSigner};
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::cli::{
|
||||
Cli, Commands, CommonArgs, DumpFormat, LogFormat, StripOptions, WebBotAuthProfileChoice,
|
||||
};
|
||||
use crate::cli::{Cli, Commands, CommonArgs, DumpFormat, StripOptions, WebBotAuthProfileChoice};
|
||||
use crate::network_trace::NetworkTraceConfigSummary;
|
||||
|
||||
pub use moli_protocol_server::ServerConfig;
|
||||
@@ -200,7 +198,6 @@ fn apply_common_args(config: &mut AppConfig, common: &CommonArgs) -> Result<()>
|
||||
config.add_document_start_script(source);
|
||||
}
|
||||
|
||||
config.fetch.log_format = common.log_format;
|
||||
config.fetch.log_filter_scopes = common.log_filter_scopes.clone();
|
||||
Ok(())
|
||||
}
|
||||
@@ -293,7 +290,6 @@ pub struct FetchCommandConfig {
|
||||
pub cookie_files: Vec<String>,
|
||||
// CLI request headers only apply to the top-level fetch command.
|
||||
pub request_headers: Vec<(String, String)>,
|
||||
pub log_format: Option<LogFormat>,
|
||||
pub log_filter_scopes: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
+4
-6
@@ -8,9 +8,9 @@ use std::{
|
||||
};
|
||||
|
||||
use moli::cli::{
|
||||
Cli, Commands, CommonArgs, DumpFormat, FetchArgs, FetchWaitUntil, LogFormat, LogLevel,
|
||||
RequestHeaderArg, ResponseJsonPathArg, ResponseRegexArg, ServeArgs, StripModeChoice,
|
||||
StripOptions, WebBotAuthProfileChoice, normalize_args_for_compat,
|
||||
Cli, Commands, CommonArgs, DumpFormat, FetchArgs, FetchWaitUntil, LogLevel, RequestHeaderArg,
|
||||
ResponseJsonPathArg, ResponseRegexArg, ServeArgs, StripModeChoice, StripOptions,
|
||||
WebBotAuthProfileChoice, normalize_args_for_compat,
|
||||
};
|
||||
use moli::config::AppConfig;
|
||||
use moli_browser_profile::BrowserProfilePaths;
|
||||
@@ -62,8 +62,6 @@ fn parses_explicit_fetch_command_with_compatibility_flags() {
|
||||
"4096",
|
||||
"--log-level",
|
||||
"info",
|
||||
"--log-format",
|
||||
"pretty",
|
||||
"--log-filter-scopes",
|
||||
"http,event",
|
||||
"--user-agent-suffix",
|
||||
@@ -137,7 +135,6 @@ fn parses_explicit_fetch_command_with_compatibility_flags() {
|
||||
block_private_networks: false,
|
||||
block_cidrs: None,
|
||||
log_level: Some(LogLevel::Info),
|
||||
log_format: Some(LogFormat::Pretty),
|
||||
log_filter_scopes: Some("http,event".to_owned()),
|
||||
user_agent: None,
|
||||
user_agent_suffix: Some("internal-tester".to_owned()),
|
||||
@@ -1394,6 +1391,7 @@ fn removed_long_form_flags_are_rejected() {
|
||||
"--enable-video-fetch",
|
||||
"--enable-media-fetch",
|
||||
"--enable-text-track-fetch",
|
||||
"--log-format",
|
||||
] {
|
||||
let error = Cli::try_parse_from(["moli", "serve", flag]).unwrap_err();
|
||||
assert_eq!(error.kind(), clap::error::ErrorKind::UnknownArgument);
|
||||
|
||||
Reference in New Issue
Block a user