Merge pull request #1186 from TheBlueMatt/2021-11-fix-log-select
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Wed, 24 Nov 2021 16:31:32 +0000 (16:31 +0000)
committerGitHub <noreply@github.com>
Wed, 24 Nov 2021 16:31:32 +0000 (16:31 +0000)
Fix the `max_level_trace` feature

.github/workflows/build.yml
lightning/src/util/macro_logger.rs

index 34337769a26677969bc8a3246c4cbb36f35648f7..90907d9fa981033d8424fd494bc0995043354429 100644 (file)
@@ -43,6 +43,7 @@ jobs:
             build-no-std: true
           - toolchain: 1.36.0
             build-no-std: false
+            test-log-variants: true
           - toolchain: 1.41.0
             build-no-std: false
           - toolchain: 1.45.2
@@ -73,6 +74,13 @@ jobs:
           cargo build --verbose  --color always -p lightning
           cargo build --verbose  --color always -p lightning-invoice
           cargo build --verbose  --color always -p lightning-persister
+      - name: Build on Rust ${{ matrix.toolchain }} with all Log-Limiting features
+        if: matrix.test-log-variants
+        run: |
+          cd lightning
+          for FEATURE in $(cat Cargo.toml | grep '^max_level_' | awk '{ print $1 }'); do
+            cargo build --verbose --color always --features $FEATURE
+          done
       - name: Build Block Sync Clients on Rust ${{ matrix.toolchain }} with features
         if: "matrix.build-net-tokio && !matrix.coverage"
         run: |
index 0210229de3a6db5fb33e9f96ffa845b4c6aa3a40..2dd73d8279cff447576817450601c85112adce74 100644 (file)
@@ -177,7 +177,7 @@ macro_rules! log_given_level {
                        #[cfg(not(any(feature = "max_level_off", feature = "max_level_error", feature = "max_level_warn", feature = "max_level_info", feature = "max_level_debug", feature = "max_level_trace")))]
                        $crate::util::logger::Level::Gossip => log_internal!($logger, $lvl, $($arg)*),
 
-                       #[cfg(any(feature = "max_level_off", feature = "max_level_error", feature = "max_level_warn", feature = "max_level_info", feature = "max_level_debug"))]
+                       #[cfg(any(feature = "max_level_off", feature = "max_level_error", feature = "max_level_warn", feature = "max_level_info", feature = "max_level_debug", feature = "max_level_trace"))]
                        _ => {
                                // The level is disabled at compile-time
                        },