lighthouse/beacon_node
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
..
beacon_chain Add test_logger as feature to logging (#2586) 2021-10-06 00:46:07 +00:00
client Remove unused deps (#2592) 2021-09-30 04:31:42 +00:00
eth1 Remove unused deps (#2592) 2021-09-30 04:31:42 +00:00
eth2_libp2p Consistent tracking of disconnected peers (#2650) 2021-09-30 04:31:43 +00:00
genesis Remove unused deps (#2592) 2021-09-30 04:31:42 +00:00
http_api Fix chain_id value in config/deposit_contract RPC method (#2659) 2021-10-01 06:32:38 +00:00
http_metrics Remove unused deps (#2592) 2021-09-30 04:31:42 +00:00
network Consistent tracking of disconnected peers (#2650) 2021-09-30 04:31:43 +00:00
operation_pool Remove unused deps (#2592) 2021-09-30 04:31:42 +00:00
src Implement checkpoint sync (#2244) 2021-09-22 00:37:28 +00:00
store Fix I/O atomicity issues with checkpoint sync (#2671) 2021-10-05 03:53:17 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Remove unused deps (#2592) 2021-09-30 04:31:42 +00:00
websocket_server Server sent events (#1920) 2020-12-04 00:18:58 +00:00
Cargo.toml Release v2.0.0 (#2673) 2021-10-05 03:53:18 +00:00