lighthouse/slasher/src
Wink Saville 58870fc6d3 Add test_logger as feature to logging (#2586)
## Issue Addressed

Fix #2585

## Proposed Changes

Provide a canonical version of test_logger that can be used
throughout lighthouse.

## Additional Info

This allows tests to conditionally emit logging data by adding
test_logger as the default logger. And then when executing
`cargo test --features logging/test_logger` log output
will be visible:

  wink@3900x:~/lighthouse/common/logging/tests/test-feature-test_logger (Add-test_logger-as-feature-to-logging)
  $ cargo test --features logging/test_logger
      Finished test [unoptimized + debuginfo] target(s) in 0.02s
       Running unittests (target/debug/deps/test_logger-e20115db6a5e3714)

  running 1 test
  Sep 10 12:53:45.212 INFO hi, module: test_logger:8
  test tests::test_fn_with_logging ... ok

  test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Doc-tests test-logger

  running 0 tests

  test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Or, in normal scenarios where logging isn't needed, executing
`cargo test` the log output will not be visible:

  wink@3900x:~/lighthouse/common/logging/tests/test-feature-test_logger (Add-test_logger-as-feature-to-logging)
  $ cargo test
      Finished test [unoptimized + debuginfo] target(s) in 0.02s
       Running unittests (target/debug/deps/test_logger-02e02f8d41e8cf8a)

  running 1 test
  test tests::test_fn_with_logging ... ok

  test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Doc-tests test-logger

  running 0 tests

  test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
2021-10-06 00:46:07 +00:00
..
array.rs update dependencies (#2032) 2020-12-07 08:20:33 +00:00
attestation_queue.rs Implement slasher (#1567) 2020-11-23 03:43:22 +00:00
attester_record.rs Implement slasher (#1567) 2020-11-23 03:43:22 +00:00
batch_stats.rs Add slasher broadcast (#2079) 2020-12-16 03:44:01 +00:00
block_queue.rs rust 1.53.0 updates (#2411) 2021-06-18 05:58:01 +00:00
config.rs Enable Compatibility with Windows (#2333) 2021-05-19 23:05:16 +00:00
database.rs Enable Compatibility with Windows (#2333) 2021-05-19 23:05:16 +00:00
error.rs Enable Compatibility with Windows (#2333) 2021-05-19 23:05:16 +00:00
lib.rs Fix slasher database schema migration to v2 (#2125) 2020-12-28 05:09:19 +00:00
metrics.rs Implement slasher (#1567) 2020-11-23 03:43:22 +00:00
migrate.rs Fix slasher database schema migration to v2 (#2125) 2020-12-28 05:09:19 +00:00
slasher.rs Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
test_utils.rs Add test_logger as feature to logging (#2586) 2021-10-06 00:46:07 +00:00
utils.rs Tweak slasher DB schema and pruning (#1948) 2020-11-23 21:33:51 +00:00