Эх сурвалжийг харах

replace log imports with tracing everywhere

oars 1 жил өмнө
parent
commit
d85cf80dbf
100 өөрчлөгдсөн 100 нэмэгдсэн , 101 устгасан
  1. 1 1
      bin/darkfid/src/lib.rs
  2. 1 1
      bin/darkfid/src/main.rs
  3. 1 1
      bin/darkfid/src/proto/mod.rs
  4. 1 1
      bin/darkfid/src/proto/protocol_proposal.rs
  5. 1 1
      bin/darkfid/src/proto/protocol_sync.rs
  6. 1 1
      bin/darkfid/src/proto/protocol_tx.rs
  7. 1 1
      bin/darkfid/src/rpc.rs
  8. 1 1
      bin/darkfid/src/rpc_blockchain.rs
  9. 1 1
      bin/darkfid/src/rpc_tx.rs
  10. 1 1
      bin/darkfid/src/rpc_xmr.rs
  11. 1 1
      bin/darkfid/src/task/consensus.rs
  12. 1 1
      bin/darkfid/src/task/garbage_collect.rs
  13. 1 1
      bin/darkfid/src/task/miner.rs
  14. 1 1
      bin/darkfid/src/task/sync.rs
  15. 1 1
      bin/darkfid/src/task/unknown_proposal.rs
  16. 1 1
      bin/darkirc/src/crypto/rln.rs
  17. 1 1
      bin/darkirc/src/irc/client.rs
  18. 1 1
      bin/darkirc/src/irc/command.rs
  19. 1 1
      bin/darkirc/src/irc/server.rs
  20. 1 1
      bin/darkirc/src/main.rs
  21. 1 1
      bin/darkirc/src/rpc.rs
  22. 1 1
      bin/darkirc/src/settings.rs
  23. 1 1
      bin/drk/src/cache.rs
  24. 1 1
      bin/drk/src/main.rs
  25. 1 1
      bin/drk/src/walletdb.rs
  26. 1 1
      bin/explorer/explorerd/src/config.rs
  27. 1 1
      bin/explorer/explorerd/src/error.rs
  28. 1 1
      bin/explorer/explorerd/src/main.rs
  29. 1 1
      bin/explorer/explorerd/src/rpc/mod.rs
  30. 1 1
      bin/explorer/explorerd/src/service/blocks.rs
  31. 1 1
      bin/explorer/explorerd/src/service/contracts.rs
  32. 1 1
      bin/explorer/explorerd/src/service/mod.rs
  33. 1 1
      bin/explorer/explorerd/src/service/sync.rs
  34. 1 1
      bin/explorer/explorerd/src/service/transactions.rs
  35. 1 1
      bin/explorer/explorerd/src/store/contract_metadata.rs
  36. 1 1
      bin/explorer/explorerd/src/store/metrics.rs
  37. 1 1
      bin/explorer/explorerd/src/store/mod.rs
  38. 1 2
      bin/fud/fu/src/main.rs
  39. 1 1
      bin/fud/fud/src/bitcoin.rs
  40. 1 1
      bin/fud/fud/src/dht.rs
  41. 1 1
      bin/fud/fud/src/download.rs
  42. 1 1
      bin/fud/fud/src/lib.rs
  43. 1 1
      bin/fud/fud/src/main.rs
  44. 1 1
      bin/fud/fud/src/pow.rs
  45. 1 1
      bin/fud/fud/src/proto.rs
  46. 1 1
      bin/fud/fud/src/rpc.rs
  47. 1 1
      bin/fud/fud/src/tasks.rs
  48. 1 1
      bin/genev/genev-cli/src/rpc.rs
  49. 1 1
      bin/genev/genevd/src/main.rs
  50. 1 1
      bin/genev/genevd/src/rpc.rs
  51. 1 1
      bin/lilith/src/main.rs
  52. 1 1
      bin/minerd/src/lib.rs
  53. 1 1
      bin/minerd/src/main.rs
  54. 1 1
      bin/minerd/src/rpc.rs
  55. 1 1
      bin/tau/taud/src/jsonrpc.rs
  56. 1 1
      bin/tau/taud/src/main.rs
  57. 1 1
      bin/tau/taud/src/month_tasks.rs
  58. 1 1
      bin/tau/taud/src/task_info.rs
  59. 1 1
      bin/tau/taud/src/util.rs
  60. 1 1
      example/dchat/dchatd/src/main.rs
  61. 1 1
      example/dchat/dchatd/src/protocol_dchat.rs
  62. 1 1
      example/dchat/dchatd/src/rpc.rs
  63. 1 1
      script/evgrd/bin/evgrd.rs
  64. 1 1
      script/evgrd/bin/rpc.rs
  65. 1 1
      script/evgrd/example/recv.rs
  66. 1 1
      script/evgrd/src/lib.rs
  67. 1 1
      script/research/blockchain-storage-metrics/src/main.rs
  68. 1 1
      script/research/dam/dam-cli/src/rpc.rs
  69. 1 1
      script/research/dam/damd/src/flooder.rs
  70. 1 1
      script/research/dam/damd/src/lib.rs
  71. 1 1
      script/research/dam/damd/src/main.rs
  72. 1 1
      script/research/dam/damd/src/proto/mod.rs
  73. 1 1
      script/research/dam/damd/src/proto/protocol_bar.rs
  74. 1 1
      script/research/dam/damd/src/proto/protocol_foo.rs
  75. 1 1
      script/research/dam/damd/src/rpc.rs
  76. 1 1
      script/research/generic-node/src/main.rs
  77. 1 1
      script/research/rlnd/rlnd/src/lib.rs
  78. 1 1
      script/research/rlnd/rlnd/src/main.rs
  79. 1 1
      script/research/rlnd/rlnd/src/rpc.rs
  80. 1 1
      src/blockchain/contract_store.rs
  81. 1 1
      src/blockchain/mod.rs
  82. 1 1
      src/contract/dao/src/client/exec.rs
  83. 1 1
      src/contract/dao/src/client/mint.rs
  84. 1 1
      src/contract/dao/src/client/vote.rs
  85. 1 1
      src/contract/dao/tests/integration.rs
  86. 1 1
      src/contract/deployooor/src/client/deploy_v1.rs
  87. 1 1
      src/contract/deployooor/src/client/lock_v1.rs
  88. 1 1
      src/contract/deployooor/tests/integration.rs
  89. 1 1
      src/contract/money/src/client/auth_token_freeze_v1.rs
  90. 1 1
      src/contract/money/src/client/auth_token_mint_v1.rs
  91. 1 1
      src/contract/money/src/client/genesis_mint_v1.rs
  92. 1 1
      src/contract/money/src/client/pow_reward_v1.rs
  93. 1 1
      src/contract/money/src/client/swap_v1.rs
  94. 1 1
      src/contract/money/src/client/token_mint_v1.rs
  95. 1 1
      src/contract/money/src/client/transfer_v1/builder.rs
  96. 1 1
      src/contract/money/src/client/transfer_v1/mod.rs
  97. 1 1
      src/contract/money/src/client/transfer_v1/proof.rs
  98. 1 1
      src/contract/money/tests/genesis_mint.rs
  99. 1 1
      src/contract/money/tests/mint_pay_swap.rs
  100. 1 1
      src/contract/money/tests/token_mint.rs

+ 1 - 1
bin/darkfid/src/lib.rs

@@ -21,8 +21,8 @@ use std::{
     sync::Arc,
 };
 
-use log::{debug, error, info, warn};
 use smol::lock::Mutex;
+use tracing::{debug, error, info, warn};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/darkfid/src/main.rs

@@ -18,9 +18,9 @@
 
 use std::sync::Arc;
 
-use log::{debug, error, info};
 use smol::{fs::read_to_string, stream::StreamExt};
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::{debug, error, info};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/darkfid/src/proto/mod.rs

@@ -25,7 +25,7 @@ use darkfi::{
     validator::ValidatorPtr,
     Result,
 };
-use log::info;
+use tracing::info;
 
 /// Block proposal broadcast protocol
 mod protocol_proposal;

+ 1 - 1
bin/darkfid/src/proto/protocol_proposal.rs

@@ -19,9 +19,9 @@
 use std::{collections::HashSet, sync::Arc};
 
 use async_trait::async_trait;
-use log::{debug, error};
 use smol::{channel::Sender, lock::RwLock};
 use tinyjson::JsonValue;
+use tracing::{debug, error};
 
 use darkfi::{
     impl_p2p_message,

+ 1 - 1
bin/darkfid/src/proto/protocol_sync.rs

@@ -19,7 +19,7 @@
 use std::sync::Arc;
 
 use async_trait::async_trait;
-use log::{debug, error};
+use tracing::{debug, error};
 
 use darkfi::{
     blockchain::{BlockInfo, Header, HeaderHash},

+ 1 - 1
bin/darkfid/src/proto/protocol_tx.rs

@@ -18,8 +18,8 @@
 
 use std::sync::Arc;
 
-use log::{debug, error};
 use tinyjson::JsonValue;
+use tracing::{debug, error};
 
 use darkfi::{
     net::{

+ 1 - 1
bin/darkfid/src/rpc.rs

@@ -19,9 +19,9 @@
 use std::{collections::HashSet, time::Instant};
 
 use async_trait::async_trait;
-use log::{debug, error, info, warn};
 use smol::lock::MutexGuard;
 use tinyjson::JsonValue;
+use tracing::{debug, error, info, warn};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/darkfid/src/rpc_blockchain.rs

@@ -23,8 +23,8 @@ use darkfi_sdk::{
     tx::TransactionHash,
 };
 use darkfi_serial::{deserialize_async, serialize_async};
-use log::{debug, error};
 use tinyjson::JsonValue;
+use tracing::{debug, error};
 
 use darkfi::{
     rpc::jsonrpc::{

+ 1 - 1
bin/darkfid/src/rpc_tx.rs

@@ -17,8 +17,8 @@
  */
 
 use darkfi_serial::deserialize_async;
-use log::{error, warn};
 use tinyjson::JsonValue;
+use tracing::{error, warn};
 
 use darkfi::{
     rpc::jsonrpc::{

+ 1 - 1
bin/darkfid/src/rpc_xmr.rs

@@ -19,8 +19,8 @@
 use std::collections::HashMap;
 
 use darkfi::rpc::jsonrpc::{ErrorCode, JsonError, JsonResponse, JsonResult};
-use log::error;
 use tinyjson::JsonValue;
+use tracing::error;
 
 use crate::DarkfiNode;
 

+ 1 - 1
bin/darkfid/src/task/consensus.rs

@@ -30,7 +30,7 @@ use darkfi_sdk::{
     pasta::{group::ff::PrimeField, pallas},
 };
 use darkfi_serial::serialize_async;
-use log::{error, info};
+use tracing::{error, info};
 
 use crate::{
     task::{garbage_collect_task, miner::MinerRewardsRecipientConfig, miner_task, sync_task},

+ 1 - 1
bin/darkfid/src/task/garbage_collect.rs

@@ -18,7 +18,7 @@
 
 use darkfi::{error::TxVerifyFailed, validator::verification::verify_transactions, Error, Result};
 use darkfi_sdk::crypto::MerkleTree;
-use log::{debug, error, info};
+use tracing::{debug, error, info};
 
 use crate::DarkfiNodePtr;
 

+ 1 - 1
bin/darkfid/src/task/miner.rs

@@ -40,10 +40,10 @@ use darkfi_sdk::{
     ContractCall,
 };
 use darkfi_serial::{serialize_async, Encodable};
-use log::{error, info};
 use num_bigint::BigUint;
 use rand::rngs::OsRng;
 use smol::channel::{Receiver, Sender};
+use tracing::{error, info};
 
 use crate::{proto::ProposalMessage, task::garbage_collect_task, DarkfiNodePtr};
 

+ 1 - 1
bin/darkfid/src/task/sync.rs

@@ -23,9 +23,9 @@ use darkfi::{
     util::encoding::base64, validator::consensus::Proposal, Error, Result,
 };
 use darkfi_serial::serialize_async;
-use log::{debug, info, warn};
 use rand::{prelude::SliceRandom, rngs::OsRng};
 use tinyjson::JsonValue;
+use tracing::{debug, info, warn};
 
 use crate::{
     proto::{

+ 1 - 1
bin/darkfid/src/task/unknown_proposal.rs

@@ -18,9 +18,9 @@
 
 use std::{collections::HashSet, sync::Arc};
 
-use log::{debug, error, info};
 use smol::{channel::Receiver, lock::RwLock};
 use tinyjson::JsonValue;
+use tracing::{debug, error, info};
 
 use darkfi::{
     blockchain::BlockDifficulty,

+ 1 - 1
bin/darkirc/src/crypto/rln.rs

@@ -32,8 +32,8 @@ use darkfi_sdk::{
     crypto::{pasta_prelude::FromUniformBytes, poseidon_hash, MerkleTree},
     pasta::pallas,
 };
-use log::info;
 use rand::{rngs::OsRng, CryptoRng, RngCore};
+use tracing::info;
 
 pub const RLN_APP_IDENTIFIER: pallas::Base = pallas::Base::from_raw([4242, 0, 0, 0]);
 pub const RLN_TRAPDOOR_DERIVATION_PATH: pallas::Base = pallas::Base::from_raw([4211, 0, 0, 0]);

+ 1 - 1
bin/darkirc/src/irc/client.rs

@@ -39,7 +39,6 @@ use darkfi_sdk::{
 };
 use darkfi_serial::{deserialize_async, serialize_async};
 use futures::FutureExt;
-use log::{debug, error, info, warn};
 use sled_overlay::sled;
 use smol::{
     io::{self, AsyncBufReadExt, AsyncWriteExt, BufReader},
@@ -47,6 +46,7 @@ use smol::{
     net::SocketAddr,
     prelude::{AsyncRead, AsyncWrite},
 };
+use tracing::{debug, error, info, warn};
 
 use super::{
     server::{IrcServer, MAX_MSG_LEN},

+ 1 - 1
bin/darkirc/src/irc/command.rs

@@ -52,7 +52,7 @@
 use std::{collections::HashSet, sync::atomic::Ordering::SeqCst};
 
 use darkfi::Result;
-use log::{error, info};
+use tracing::{error, info};
 
 use super::{
     client::{Client, ReplyType},

+ 1 - 1
bin/darkirc/src/irc/server.rs

@@ -38,7 +38,6 @@ use futures_rustls::{
     rustls::{self, pki_types::PrivateKeyDer},
     TlsAcceptor,
 };
-use log::{debug, error, info, warn};
 use sled_overlay::sled;
 use smol::{
     fs,
@@ -47,6 +46,7 @@ use smol::{
     prelude::{AsyncRead, AsyncWrite},
     Executor,
 };
+use tracing::{debug, error, info, warn};
 use url::Url;
 
 use super::{client::Client, IrcChannel, IrcContact, Priv, Privmsg};

+ 1 - 1
bin/darkirc/src/main.rs

@@ -33,12 +33,12 @@ use darkfi::{
 };
 use darkfi_sdk::crypto::pasta_prelude::PrimeField;
 
-use log::{debug, error, info};
 use rand::rngs::OsRng;
 use settings::list_configured_contacts;
 use sled_overlay::sled;
 use smol::{fs, lock::Mutex, stream::StreamExt, Executor};
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::{debug, error, info};
 use url::Url;
 
 const CONFIG_FILE: &str = "darkirc_config.toml";

+ 1 - 1
bin/darkirc/src/rpc.rs

@@ -29,8 +29,8 @@ use darkfi::{
     },
     system::StoppableTaskPtr,
 };
-use log::debug;
 use smol::lock::MutexGuard;
+use tracing::debug;
 
 use super::DarkIrc;
 

+ 1 - 1
bin/darkirc/src/settings.rs

@@ -25,7 +25,7 @@ use std::{
 use crypto_box::PublicKey;
 use darkfi::{Error::ParseFailed, Result};
 use darkfi_sdk::{crypto::pasta_prelude::PrimeField, pasta::pallas};
-use log::info;
+use tracing::info;
 
 use crate::{
     crypto::rln::{closest_epoch, RlnIdentity},

+ 1 - 1
bin/drk/src/cache.rs

@@ -29,9 +29,9 @@ use darkfi_sdk::{
     pasta::pallas,
 };
 use darkfi_serial::{deserialize, serialize};
-use log::error;
 use num_bigint::BigUint;
 use sled_overlay::{sled, SledDbOverlay, SledDbOverlayStateDiff};
+use tracing::error;
 
 pub const SLED_SCANNED_BLOCKS_TREE: &[u8] = b"_scanned_blocks";
 pub const SLED_STATE_INVERSE_DIFF_TREE: &[u8] = b"_state_inverse_diff";

+ 1 - 1
bin/drk/src/main.rs

@@ -22,11 +22,11 @@ use std::{
     str::FromStr,
 };
 
-use log::info;
 use prettytable::{format, row, Table};
 use rand::rngs::OsRng;
 use smol::{fs::read_to_string, stream::StreamExt};
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::info;
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/drk/src/walletdb.rs

@@ -21,11 +21,11 @@ use std::{
     sync::{Arc, Mutex},
 };
 
-use log::{debug, error};
 use rusqlite::{
     types::{ToSql, Value},
     Connection,
 };
+use tracing::{debug, error};
 
 use crate::error::{WalletDbError, WalletDbResult};
 

+ 1 - 1
bin/explorer/explorerd/src/config.rs

@@ -22,9 +22,9 @@ use std::{
     str::FromStr,
 };
 
-use log::{debug, error};
 use serde::Deserialize;
 use structopt::StructOpt;
+use tracing::{debug, error};
 use url::Url;
 
 use darkfi::{rpc::settings::RpcSettingsOpt, util::file::load_file, Error, Result};

+ 1 - 1
bin/explorer/explorerd/src/error.rs

@@ -18,7 +18,7 @@
 
 use std::{fmt, sync::Arc};
 
-use log::error;
+use tracing::error;
 
 use darkfi::{
     error::RpcError,

+ 1 - 1
bin/explorer/explorerd/src/main.rs

@@ -18,9 +18,9 @@
 
 use std::{collections::HashSet, path::Path, sync::Arc};
 
-use log::{error, info};
 use smol::{lock::Mutex, stream::StreamExt};
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::{error, info};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/explorer/explorerd/src/rpc/mod.rs

@@ -19,9 +19,9 @@
 use std::{collections::HashSet, sync::Arc, time::Instant};
 
 use async_trait::async_trait;
-use log::{debug, error, trace, warn};
 use smol::lock::{MutexGuard, RwLock};
 use tinyjson::JsonValue;
+use tracing::{debug, error, trace, warn};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/explorer/explorerd/src/service/blocks.rs

@@ -16,9 +16,9 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
-use log::{debug, warn};
 use sled_overlay::sled::{transaction::ConflictableTransactionError, Transactional};
 use tinyjson::JsonValue;
+use tracing::{debug, warn};
 
 use darkfi::{
     blockchain::{

+ 1 - 1
bin/explorer/explorerd/src/service/contracts.rs

@@ -21,9 +21,9 @@ use std::{
     str::FromStr,
 };
 
-use log::info;
 use tar::Archive;
 use tinyjson::JsonValue;
+use tracing::info;
 
 use darkfi::{
     blockchain::BlockchainOverlay, validator::utils::deploy_native_contracts, Error, Result,

+ 1 - 1
bin/explorer/explorerd/src/service/mod.rs

@@ -18,7 +18,7 @@
 
 use std::sync::Arc;
 
-use log::debug;
+use tracing::debug;
 
 use darkfi::Result;
 

+ 1 - 1
bin/explorer/explorerd/src/service/sync.rs

@@ -38,8 +38,8 @@
 
 use std::{sync::Arc, time::Instant};
 
-use log::{debug, error, info, warn};
 use tinyjson::JsonValue;
+use tracing::{debug, error, info, warn};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/explorer/explorerd/src/service/transactions.rs

@@ -18,9 +18,9 @@
 
 use std::collections::HashMap;
 
-use log::{debug, error};
 use smol::io::Cursor;
 use tinyjson::JsonValue;
+use tracing::{debug, error};
 
 use darkfi::{
     blockchain::{

+ 1 - 1
bin/explorer/explorerd/src/store/contract_metadata.rs

@@ -18,8 +18,8 @@
 
 use std::sync::{Arc, Mutex, MutexGuard};
 
-use log::debug;
 use sled_overlay::{sled, SledDbOverlay};
+use tracing::debug;
 
 use darkfi::{blockchain::SledDbOverlayPtr, Error, Result};
 use darkfi_sdk::crypto::ContractId;

+ 1 - 1
bin/explorer/explorerd/src/store/metrics.rs

@@ -21,8 +21,8 @@ use std::{
     sync::{Arc, Mutex, MutexGuard},
 };
 
-use log::{debug, info};
 use sled_overlay::{sled, SledDbOverlay};
+use tracing::{debug, info};
 
 use darkfi::{
     blockchain::SledDbOverlayPtr,

+ 1 - 1
bin/explorer/explorerd/src/store/mod.rs

@@ -19,8 +19,8 @@
 use std::collections::HashMap;
 
 use lazy_static::lazy_static;
-use log::info;
 use sled_overlay::sled;
+use tracing::info;
 
 use darkfi::{blockchain::Blockchain, error::Result, util::path::expand_path};
 

+ 1 - 2
bin/fud/fu/src/main.rs

@@ -17,8 +17,6 @@
  */
 
 use clap::{Parser, Subcommand};
-use log::error;
-use simplelog::{ColorChoice, TermLogger, TerminalMode};
 use smol::lock::RwLock;
 use std::{
     collections::HashMap,
@@ -26,6 +24,7 @@ use std::{
     sync::Arc,
 };
 use termcolor::{StandardStream, WriteColor};
+use tracing::error;
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/fud/fud/src/bitcoin.rs

@@ -23,11 +23,11 @@ use std::{
     time::Duration,
 };
 
-use log::{error, info, warn};
 use rand::{prelude::SliceRandom, rngs::OsRng};
 use sha2::{Digest, Sha256};
 use smol::lock::RwLock;
 use tinyjson::JsonValue;
+use tracing::{error, info, warn};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/fud/fud/src/dht.rs

@@ -19,9 +19,9 @@
 use std::sync::Arc;
 
 use async_trait::async_trait;
-use log::debug;
 use num_bigint::BigUint;
 use rand::{rngs::OsRng, Rng};
+use tracing::debug;
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/fud/fud/src/download.rs

@@ -23,11 +23,11 @@ use std::{
 };
 
 use futures::{future::FutureExt, pin_mut, select};
-use log::{error, info, warn};
 use rand::{
     prelude::{IteratorRandom, SliceRandom},
     rngs::OsRng,
 };
+use tracing::{error, info, warn};
 
 use darkfi::{
     dht::DhtNode,

+ 1 - 1
bin/fud/fud/src/lib.rs

@@ -23,13 +23,13 @@ use std::{
     sync::Arc,
 };
 
-use log::{error, info, warn};
 use sled_overlay::sled;
 use smol::{
     channel,
     fs::{self, OpenOptions},
     lock::RwLock,
 };
+use tracing::{error, info, warn};
 
 use darkfi::{
     dht::{tasks as dht_tasks, Dht, DhtHandler, DhtSettings},

+ 1 - 1
bin/fud/fud/src/main.rs

@@ -16,11 +16,11 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
-use log::{debug, error, info, warn};
 use sled_overlay::sled;
 use smol::{stream::StreamExt, Executor};
 use std::sync::Arc;
 use structopt_toml::StructOptToml;
+use tracing::{debug, error, info, warn};
 
 use darkfi::{
     async_daemonize,

+ 1 - 1
bin/fud/fud/src/pow.rs

@@ -21,10 +21,10 @@ use std::{
     sync::Arc,
 };
 
-use log::info;
 use rand::rngs::OsRng;
 use smol::lock::RwLock;
 use structopt::StructOpt;
+use tracing::info;
 use url::Url;
 
 use darkfi::{system::ExecutorPtr, Error, Result};

+ 1 - 1
bin/fud/fud/src/proto.rs

@@ -17,9 +17,9 @@
  */
 
 use async_trait::async_trait;
-use log::{debug, error, info};
 use smol::Executor;
 use std::{path::StripPrefixError, sync::Arc};
+use tracing::{debug, error, info};
 
 use darkfi::{
     dht::DhtHandler,

+ 1 - 1
bin/fud/fud/src/rpc.rs

@@ -17,7 +17,6 @@
  */
 
 use async_trait::async_trait;
-use log::error;
 use smol::lock::{Mutex, MutexGuard};
 use std::{
     collections::{HashMap, HashSet},
@@ -25,6 +24,7 @@ use std::{
     sync::Arc,
 };
 use tinyjson::JsonValue;
+use tracing::error;
 
 use darkfi::{
     dht::DhtNode,

+ 1 - 1
bin/fud/fud/src/tasks.rs

@@ -18,7 +18,7 @@
 
 use std::sync::Arc;
 
-use log::{error, info, warn};
+use tracing::{error, info, warn};
 
 use darkfi::{
     dht::{DhtHandler, DhtNode},

+ 1 - 1
bin/genev/genev-cli/src/rpc.rs

@@ -23,8 +23,8 @@ use darkfi::{
 };
 use darkfi_serial::{deserialize, serialize};
 use genevd::GenEvent;
-use log::debug;
 use tinyjson::JsonValue;
+use tracing::debug;
 
 pub struct Gen {
     pub rpc_client: RpcClient,

+ 1 - 1
bin/genev/genevd/src/main.rs

@@ -31,10 +31,10 @@ use darkfi::{
     util::path::expand_path,
     Error, Result,
 };
-use log::{debug, error, info};
 use sled_overlay::sled;
 use smol::{fs, lock::RwLock, stream::StreamExt};
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::{debug, error, info};
 
 mod rpc;
 use rpc::JsonRpcInterface;

+ 1 - 1
bin/genev/genevd/src/rpc.rs

@@ -19,9 +19,9 @@
 use std::collections::HashSet;
 
 use async_trait::async_trait;
-use log::{debug, error};
 use smol::lock::{Mutex, MutexGuard};
 use tinyjson::JsonValue;
+use tracing::{debug, error};
 
 use darkfi::{
     event_graph::{proto::EventPut, Event, EventGraphPtr},

+ 1 - 1
bin/lilith/src/main.rs

@@ -24,7 +24,6 @@ use std::{
 };
 
 use async_trait::async_trait;
-use log::{debug, error, info, warn};
 use semver::Version;
 use smol::{
     lock::{Mutex, MutexGuard},
@@ -35,6 +34,7 @@ use structopt::StructOpt;
 use structopt_toml::StructOptToml;
 use tinyjson::JsonValue;
 use toml::Value;
+use tracing::{debug, error, info, warn};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
bin/minerd/src/lib.rs

@@ -18,11 +18,11 @@
 
 use std::{collections::HashSet, sync::Arc};
 
-use log::{error, info};
 use smol::{
     channel::{Receiver, Sender},
     lock::Mutex,
 };
+use tracing::{error, info};
 
 use darkfi::{
     rpc::{

+ 1 - 1
bin/minerd/src/main.rs

@@ -18,9 +18,9 @@
 
 use std::sync::Arc;
 
-use log::info;
 use smol::{stream::StreamExt, Executor};
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::info;
 
 use darkfi::{async_daemonize, cli_desc, rpc::settings::RpcSettingsOpt, Error, Result};
 

+ 1 - 1
bin/minerd/src/rpc.rs

@@ -18,9 +18,9 @@
 
 use std::collections::HashSet;
 
-use log::{debug, error, info};
 use num_bigint::BigUint;
 use smol::lock::MutexGuard;
+use tracing::{debug, error, info};
 
 use darkfi::{
     blockchain::BlockInfo,

+ 1 - 1
bin/tau/taud/src/jsonrpc.rs

@@ -24,9 +24,9 @@ use std::{
 };
 
 use async_trait::async_trait;
-use log::{debug, info, warn};
 use smol::lock::{Mutex, MutexGuard};
 use tinyjson::JsonValue;
+use tracing::{debug, info, warn};
 
 use darkfi::{
     event_graph::EventGraphPtr,

+ 1 - 1
bin/tau/taud/src/main.rs

@@ -36,12 +36,12 @@ use darkfi_serial::{
 };
 use futures::{select, FutureExt};
 use libc::mkfifo;
-use log::{debug, error, info};
 use rand::rngs::OsRng;
 use sled_overlay::sled;
 use smol::{fs, stream::StreamExt};
 use structopt_toml::StructOptToml;
 use tinyjson::JsonValue;
+use tracing::{debug, error, info};
 
 use darkfi::{
     async_daemonize,

+ 1 - 1
bin/tau/taud/src/month_tasks.rs

@@ -23,8 +23,8 @@ use std::{
 };
 
 use chrono::{TimeZone, Utc};
-use log::debug;
 use tinyjson::JsonValue;
+use tracing::debug;
 
 use darkfi::util::{
     file::{load_json_file, save_json_file},

+ 1 - 1
bin/tau/taud/src/task_info.rs

@@ -24,8 +24,8 @@ use std::{
 };
 
 use darkfi_serial::{async_trait, SerialDecodable, SerialEncodable};
-use log::debug;
 use tinyjson::JsonValue;
+use tracing::debug;
 
 use darkfi::{
     util::{

+ 1 - 1
bin/tau/taud/src/util.rs

@@ -22,7 +22,7 @@ use std::{
     path::Path,
 };
 
-use log::debug;
+use tracing::debug;
 
 use darkfi::{Error, Result};
 use rand::{distributions::Alphanumeric, rngs::OsRng, Rng};

+ 1 - 1
example/dchat/dchatd/src/main.rs

@@ -17,9 +17,9 @@
  */
 
 // ANCHOR: imports
-use log::{debug, error, info};
 use smol::{lock::Mutex, stream::StreamExt};
 use std::{collections::HashSet, sync::Arc};
+use tracing::{debug, error, info};
 
 use darkfi::{
     async_daemonize, cli_desc, net,

+ 1 - 1
example/dchat/dchatd/src/protocol_dchat.rs

@@ -19,9 +19,9 @@
 // ANCHOR: protocol_dchat
 use async_trait::async_trait;
 use darkfi::{net, Result};
-use log::debug;
 use smol::Executor;
 use std::sync::Arc;
+use tracing::debug;
 
 use crate::dchatmsg::{DchatMsg, DchatMsgsBuffer};
 

+ 1 - 1
example/dchat/dchatd/src/rpc.rs

@@ -18,9 +18,9 @@
 
 use async_trait::async_trait;
 use darkfi::{net::P2pPtr, system::StoppableTaskPtr};
-use log::debug;
 use smol::lock::MutexGuard;
 use std::collections::HashSet;
+use tracing::debug;
 
 use darkfi::rpc::{
     jsonrpc::{ErrorCode, JsonError, JsonRequest, JsonResponse, JsonResult},

+ 1 - 1
script/evgrd/bin/evgrd.rs

@@ -39,7 +39,7 @@ use darkfi::{
 };
 use darkfi_serial::{AsyncDecodable, AsyncEncodable};
 use futures::{FutureExt, AsyncWriteExt};
-use log::{debug, error, info};
+use tracing::{debug, error, info};
 use sled_overlay::sled;
 use smol::{fs, lock::Mutex, stream::StreamExt, Executor};
 use std::{collections::HashSet, path::PathBuf, sync::Arc};

+ 1 - 1
script/evgrd/bin/rpc.rs

@@ -29,7 +29,7 @@ use darkfi::{
     },
     system::StoppableTaskPtr,
 };
-use log::debug;
+use tracing::debug;
 use smol::lock::MutexGuard;
 
 use super::Daemon;

+ 1 - 1
script/evgrd/example/recv.rs

@@ -26,7 +26,7 @@ use darkfi_serial::{
     async_trait, deserialize_async_partial, AsyncDecodable, AsyncEncodable, SerialDecodable,
     SerialEncodable,
 };
-use log::{error, info};
+use tracing::{error, info};
 use sled_overlay::sled;
 use smol::fs;
 use url::Url;

+ 1 - 1
script/evgrd/src/lib.rs

@@ -27,7 +27,7 @@ use darkfi::{
 use darkfi_serial::{
     async_trait, deserialize_async, serialize_async, SerialDecodable, SerialEncodable,
 };
-use log::{debug, error, info};
+use tracing::{debug, error, info};
 use sled_overlay::{sled, SledTreeOverlay};
 use smol::{
     lock::{OnceCell, RwLock},

+ 1 - 1
script/research/blockchain-storage-metrics/src/main.rs

@@ -18,9 +18,9 @@
 
 use std::{fmt, sync::Arc};
 
-use log::info;
 use smol::stream::StreamExt;
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::info;
 use url::Url;
 
 use darkfi::{

+ 1 - 1
script/research/dam/dam-cli/src/rpc.rs

@@ -27,7 +27,7 @@ use darkfi::{
     system::{ExecutorPtr, Publisher, StoppableTask},
     Error, Result,
 };
-use log::{error, info};
+use tracing::{error, info};
 use url::Url;
 
 use crate::DamCli;

+ 1 - 1
script/research/dam/damd/src/flooder.rs

@@ -27,9 +27,9 @@ use darkfi::{
     system::{ExecutorPtr, StoppableTask, StoppableTaskPtr},
     Error, Result,
 };
-use log::{debug, error, info};
 use smol::lock::Mutex;
 use tinyjson::JsonValue;
+use tracing::{debug, error, info};
 
 use crate::proto::{
     protocol_bar::Bar,

+ 1 - 1
script/research/dam/damd/src/lib.rs

@@ -21,8 +21,8 @@ use std::{
     sync::Arc,
 };
 
-use log::{debug, error, info};
 use smol::lock::Mutex;
+use tracing::{debug, error, info};
 
 use darkfi::{
     net::settings::Settings,

+ 1 - 1
script/research/dam/damd/src/main.rs

@@ -19,9 +19,9 @@
 use std::sync::Arc;
 
 use async_std::prelude::StreamExt;
-use log::info;
 use smol::Executor;
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::info;
 
 use darkfi::{
     async_daemonize, cli_desc, net::settings::SettingsOpt, rpc::settings::RpcSettingsOpt, Error,

+ 1 - 1
script/research/dam/damd/src/proto/mod.rs

@@ -24,7 +24,7 @@ use darkfi::{
     system::ExecutorPtr,
     Result,
 };
-use log::info;
+use tracing::info;
 
 /// `Foo` messages broadcast protocol
 pub mod protocol_foo;

+ 1 - 1
script/research/dam/damd/src/proto/protocol_bar.rs

@@ -19,8 +19,8 @@
 use std::sync::Arc;
 
 use async_trait::async_trait;
-use log::{debug, error, info};
 use tinyjson::JsonValue;
+use tracing::{debug, error, info};
 
 use darkfi::{
     impl_p2p_message,

+ 1 - 1
script/research/dam/damd/src/proto/protocol_foo.rs

@@ -19,8 +19,8 @@
 use std::sync::Arc;
 
 use async_trait::async_trait;
-use log::{debug, error, info};
 use tinyjson::JsonValue;
+use tracing::{debug, error, info};
 
 use darkfi::{
     impl_p2p_message,

+ 1 - 1
script/research/dam/damd/src/rpc.rs

@@ -19,8 +19,8 @@
 use std::collections::HashSet;
 
 use async_trait::async_trait;
-use log::debug;
 use smol::lock::MutexGuard;
+use tracing::debug;
 
 use darkfi::{
     net::P2pPtr,

+ 1 - 1
script/research/generic-node/src/main.rs

@@ -18,7 +18,7 @@
 
 use std::{collections::HashSet, sync::Arc};
 
-use log::{error, info};
+use tracing::{error, info};
 use rand::{rngs::OsRng, Rng};
 use smol::{stream::StreamExt, Executor};
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};

+ 1 - 1
script/research/rlnd/rlnd/src/lib.rs

@@ -18,8 +18,8 @@
 
 use std::{collections::HashSet, sync::Arc};
 
-use log::{error, info};
 use smol::lock::Mutex;
+use tracing::{error, info};
 use url::Url;
 
 use darkfi::{

+ 1 - 1
script/research/rlnd/rlnd/src/main.rs

@@ -19,8 +19,8 @@
 use std::sync::Arc;
 
 use async_std::prelude::StreamExt;
-use log::info;
 use structopt_toml::{serde::Deserialize, structopt::StructOpt, StructOptToml};
+use tracing::info;
 use url::Url;
 
 use darkfi::{async_daemonize, cli_desc, rpc::settings::RpcSettingsOpt, Error, Result};

+ 1 - 1
script/research/rlnd/rlnd/src/rpc.rs

@@ -30,9 +30,9 @@ use darkfi::{
 };
 use darkfi_sdk::{crypto::pasta_prelude::PrimeField, pasta::pallas};
 use darkfi_serial::serialize;
-use log::{debug, error, info};
 use smol::lock::MutexGuard;
 use tinyjson::JsonValue;
+use tracing::{debug, error, info};
 use url::Url;
 
 use crate::{

+ 1 - 1
src/blockchain/contract_store.rs

@@ -26,8 +26,8 @@ use darkfi_sdk::{
     monotree::Monotree,
 };
 use darkfi_serial::{deserialize, serialize};
-use log::{debug, error};
 use sled_overlay::{serial::parse_record, sled, SledDbOverlay};
+use tracing::{debug, error};
 
 use crate::{
     zk::{empty_witnesses, VerifyingKey, ZkCircuit},

+ 1 - 1
src/blockchain/mod.rs

@@ -19,8 +19,8 @@
 use std::sync::{Arc, Mutex};
 
 use darkfi_sdk::{monotree::Monotree, tx::TransactionHash};
-use log::debug;
 use sled_overlay::{sled, sled::Transactional};
+use tracing::debug;
 
 use crate::{tx::Transaction, util::time::Timestamp, Error, Result};
 

+ 1 - 1
src/contract/dao/src/client/exec.rs

@@ -21,8 +21,8 @@ use darkfi_sdk::{
     pasta::pallas,
 };
 
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use darkfi::{
     zk::{halo2::Value, Proof, ProvingKey, Witness, ZkCircuit},

+ 1 - 1
src/contract/dao/src/client/mint.rs

@@ -22,8 +22,8 @@ use darkfi::{
     Result,
 };
 use darkfi_sdk::{crypto::SecretKey, pasta::pallas};
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use crate::model::{Dao, DaoMintParams};
 

+ 1 - 1
src/contract/dao/src/client/vote.rs

@@ -30,8 +30,8 @@ use darkfi_sdk::{
     },
     pasta::pallas,
 };
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use darkfi::{
     zk::{halo2::Value, Proof, ProvingKey, Witness, ZkCircuit},

+ 1 - 1
src/contract/dao/tests/integration.rs

@@ -37,8 +37,8 @@ use darkfi_sdk::{
     },
     pasta::pallas,
 };
-use log::info;
 use rand::rngs::OsRng;
+use tracing::info;
 
 // Integration test configuration
 // Holders this test will use:

+ 1 - 1
src/contract/deployooor/src/client/deploy_v1.rs

@@ -18,7 +18,7 @@
 
 use darkfi::{ClientFailed, Result};
 use darkfi_sdk::{crypto::Keypair, deploy::DeployParamsV1};
-use log::{debug, error};
+use tracing::{debug, error};
 
 use crate::error::DeployError;
 

+ 1 - 1
src/contract/deployooor/src/client/lock_v1.rs

@@ -18,7 +18,7 @@
 
 use darkfi::Result;
 use darkfi_sdk::crypto::Keypair;
-use log::debug;
+use tracing::debug;
 
 use crate::model::LockParamsV1;
 

+ 1 - 1
src/contract/deployooor/tests/integration.rs

@@ -18,7 +18,7 @@
 
 use darkfi::Result;
 use darkfi_contract_test_harness::{init_logger, Holder, TestHarness};
-use log::info;
+use tracing::info;
 
 #[test]
 fn deploy_integration() -> Result<()> {

+ 1 - 1
src/contract/money/src/client/auth_token_freeze_v1.rs

@@ -22,8 +22,8 @@ use darkfi::{
     Result,
 };
 use darkfi_sdk::crypto::Keypair;
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use crate::model::{MoneyAuthTokenFreezeParamsV1, TokenAttributes};
 

+ 1 - 1
src/contract/money/src/client/auth_token_mint_v1.rs

@@ -22,8 +22,8 @@ use darkfi::{
     Result,
 };
 use darkfi_sdk::crypto::{note::AeadEncryptedNote, Blind, Keypair};
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use crate::{
     client::MoneyNote,

+ 1 - 1
src/contract/money/src/client/genesis_mint_v1.rs

@@ -25,8 +25,8 @@ use darkfi_sdk::{
     crypto::{note::AeadEncryptedNote, pasta_prelude::*, Blind, FuncId, PublicKey},
     pasta::pallas,
 };
-use log::debug;
 use rand::{prelude::SliceRandom, rngs::OsRng};
+use tracing::debug;
 
 use crate::{
     client::{

+ 1 - 1
src/contract/money/src/client/pow_reward_v1.rs

@@ -26,8 +26,8 @@ use darkfi_sdk::{
     crypto::{note::AeadEncryptedNote, pasta_prelude::*, Blind, FuncId, PublicKey},
     pasta::pallas,
 };
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use crate::{
     client::{

+ 1 - 1
src/contract/money/src/client/swap_v1.rs

@@ -31,8 +31,8 @@ use darkfi_sdk::{
     pasta::pallas,
 };
 use darkfi_serial::serialize;
-use log::{debug, error};
 use rand::rngs::OsRng;
+use tracing::{debug, error};
 
 use crate::{
     client::{

+ 1 - 1
src/contract/money/src/client/token_mint_v1.rs

@@ -22,8 +22,8 @@ use darkfi::{
     Result,
 };
 use darkfi_sdk::pasta::pallas;
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use crate::model::{CoinAttributes, MoneyTokenMintParamsV1, TokenAttributes};
 

+ 1 - 1
src/contract/money/src/client/transfer_v1/builder.rs

@@ -28,8 +28,8 @@ use darkfi_sdk::{
     },
     pasta::pallas,
 };
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use super::proof::{create_transfer_burn_proof, create_transfer_mint_proof};
 use crate::{

+ 1 - 1
src/contract/money/src/client/transfer_v1/mod.rs

@@ -21,8 +21,8 @@ use darkfi_sdk::{
     crypto::{pasta_prelude::*, Blind, FuncId, Keypair, MerkleTree, PublicKey},
     pasta::pallas,
 };
-use log::{debug, error};
 use rand::{prelude::SliceRandom, rngs::OsRng};
+use tracing::{debug, error};
 
 use crate::{
     client::OwnCoin,

+ 1 - 1
src/contract/money/src/client/transfer_v1/proof.rs

@@ -29,8 +29,8 @@ use darkfi_sdk::{
     },
     pasta::pallas,
 };
-use log::debug;
 use rand::rngs::OsRng;
+use tracing::debug;
 
 use super::{TransferCallInput, TransferCallOutput};
 use crate::model::{Coin, CoinAttributes, Nullifier};

+ 1 - 1
src/contract/money/tests/genesis_mint.rs

@@ -27,7 +27,7 @@
 
 use darkfi::Result;
 use darkfi_contract_test_harness::{init_logger, Holder, TestHarness};
-use log::info;
+use tracing::info;
 
 #[test]
 fn genesis_mint() -> Result<()> {

+ 1 - 1
src/contract/money/tests/mint_pay_swap.rs

@@ -30,8 +30,8 @@
 use darkfi::Result;
 use darkfi_contract_test_harness::{init_logger, Holder, TestHarness};
 use darkfi_sdk::crypto::BaseBlind;
-use log::info;
 use rand::rngs::OsRng;
+use tracing::info;
 
 #[test]
 fn mint_pay_swap() -> Result<()> {

+ 1 - 1
src/contract/money/tests/token_mint.rs

@@ -19,8 +19,8 @@
 use darkfi::Result;
 use darkfi_contract_test_harness::{init_logger, Holder, TestHarness};
 use darkfi_sdk::crypto::BaseBlind;
-use log::info;
 use rand::rngs::OsRng;
+use tracing::info;
 
 #[test]
 fn token_mint() -> Result<()> {

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно