grandpa: remove deprecated afg log target (#13064)

* grandpa: remove deprecated afg log target

* grandpa: define log targets in primitives
This commit is contained in:
André Silva
2023-01-05 12:33:08 +00:00
committed by GitHub
parent f2dcd9520c
commit 44768ae56a
5 changed files with 17 additions and 16 deletions
+3 -3
View File
@@ -76,6 +76,9 @@ use sp_application_crypto::AppKey;
use sp_blockchain::{Error as ClientError, HeaderBackend, HeaderMetadata, Result as ClientResult};
use sp_consensus::SelectChain;
use sp_core::crypto::ByteArray;
use sp_finality_grandpa::{
AuthorityList, AuthoritySignature, SetId, CLIENT_LOG_TARGET as LOG_TARGET,
};
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
use sp_runtime::{
generic::BlockId,
@@ -93,8 +96,6 @@ use std::{
time::Duration,
};
const LOG_TARGET: &str = "grandpa";
// utility logging macro that takes as first argument a conditional to
// decide whether to log under debug or info level (useful to restrict
// logging under initial sync).
@@ -142,7 +143,6 @@ pub use voting_rule::{
use aux_schema::PersistentData;
use communication::{Network as NetworkT, NetworkBridge};
use environment::{Environment, VoterSetState};
use sp_finality_grandpa::{AuthorityList, AuthoritySignature, SetId};
use until_imported::UntilGlobalMessageBlocksImported;
// Re-export these two because it's just so damn convenient.
+4 -4
View File
@@ -377,7 +377,7 @@ mod tests {
fn test_logger_filters() {
run_test_in_another_process("test_logger_filters", || {
let test_directives =
"afg=debug,sync=trace,client=warn,telemetry,something-with-dash=error";
"grandpa=debug,sync=trace,client=warn,telemetry,something-with-dash=error";
init_logger(&test_directives);
tracing::dispatcher::get_default(|dispatcher| {
@@ -402,9 +402,9 @@ mod tests {
dispatcher.enabled(&metadata)
};
assert!(test_filter("afg", Level::INFO));
assert!(test_filter("afg", Level::DEBUG));
assert!(!test_filter("afg", Level::TRACE));
assert!(test_filter("grandpa", Level::INFO));
assert!(test_filter("grandpa", Level::DEBUG));
assert!(!test_filter("grandpa", Level::TRACE));
assert!(test_filter("sync", Level::TRACE));
assert!(test_filter("client", Level::WARN));