Runtime logging. (#3821)

* Implement Printable for tuples.

* Add debugging function.

* Add debug 1.

* Implement  for everything.

* RuntimeDebug derive.

* Introduce RuntimeDebug.

* Add some dummy logging.

* Replace RuntimeDebug with Debug.

* Revert "Replace RuntimeDebug with Debug."

This reverts commit bc47070a8cb30241b2b590b2fa29fd195088162f.

* Working on Debug for all.

* Fix bounds.

* Add debug utils.

* Implement runtime logging.

* Add some docs and clean up.

* Clean up derives.

* Fix custom derive impl.

* Bump runtime.

* Fix long lines.

* Fix doc test.

* Use CARGO_CFG_STD.

* Revert "Use CARGO_CFG_STD."

This reverts commit ea429566de18ed0fa052571b359eb9826a64a9f4.

* Use parse_macro_input

* Update lockfile.

* Apply review suggestions.

* Remove stray re-export.

* Add no-std impl.

* Update lockfile.
This commit is contained in:
Tomasz Drwięga
2019-10-22 14:13:44 +02:00
committed by Bastian Köcher
parent 934d7aac1c
commit 20a3989785
86 changed files with 1266 additions and 469 deletions
+6 -5
View File
@@ -25,7 +25,10 @@
use rstd::prelude::*;
use sr_primitives::{
print, traits::{Zero, One, StaticLookup, Bounded, Saturating}, weights::SimpleDispatchInfo,
RuntimeDebug,
print,
traits::{Zero, One, StaticLookup, Bounded, Saturating},
weights::SimpleDispatchInfo,
};
use support::{
dispatch::Result, decl_storage, decl_event, ensure, decl_module,
@@ -98,8 +101,7 @@ mod tests;
// entries before they increase the capacity.
/// The activity status of a voter.
#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, Default)]
#[cfg_attr(feature = "std", derive(Debug))]
#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, Default, RuntimeDebug)]
pub struct VoterInfo<Balance> {
/// Last VoteIndex in which this voter assigned (or initialized) approvals.
last_active: VoteIndex,
@@ -114,8 +116,7 @@ pub struct VoterInfo<Balance> {
}
/// Used to demonstrate the status of a particular index in the global voter list.
#[derive(PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug))]
#[derive(PartialEq, Eq, RuntimeDebug)]
pub enum CellStatus {
/// Any out of bound index. Means a push a must happen to the chunk pointed by `NextVoterSet<T>`.
/// Voting fee is applied in case a new chunk is created.