Validator log filter may now be reconfigured at runtime (#5473)

* Log filter may now be reconfigured at runtime

* Add RPC API and bash script to reconfigure the log filter
This commit is contained in:
Michael Vines
2019-08-10 22:54:46 -07:00
committed by GitHub
parent 799d3b1575
commit 54f4d13350
5 changed files with 73 additions and 12 deletions

View File

@ -328,6 +328,9 @@ pub trait RpcSol {
#[rpc(meta, name = "getVersion")]
fn get_version(&self, _: Self::Metadata) -> Result<RpcVersionInfo>;
#[rpc(meta, name = "setLogFilter")]
fn set_log_filter(&self, _: Self::Metadata, _: String) -> Result<()>;
}
pub struct RpcSolImpl;
@ -619,6 +622,11 @@ impl RpcSol for RpcSolImpl {
solana_core: VERSION.to_string(),
})
}
fn set_log_filter(&self, _: Self::Metadata, filter: String) -> Result<()> {
solana_logger::setup_with_filter(&filter);
Ok(())
}
}
#[cfg(test)]