X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2Fexperimental%2Flogging%2FLogCategory.h;h=565373a7d6f2cc716f3df099ca32ad6233e95a74;hp=4779a4728850b1ca383c0ff279bcdc4837b5f242;hb=b6e14b7b1823915a6891bd2fa622bca8f4c61004;hpb=2fa201bf02cf80f9f2031b4bba70e3413da37efb diff --git a/folly/experimental/logging/LogCategory.h b/folly/experimental/logging/LogCategory.h index 4779a472..565373a7 100644 --- a/folly/experimental/logging/LogCategory.h +++ b/folly/experimental/logging/LogCategory.h @@ -75,6 +75,15 @@ class LogCategory { level_.load(std::memory_order_acquire) & ~FLAG_INHERIT); } + /** + * Get the log level and inheritance flag. + */ + std::pair getLevelInfo() const { + auto value = level_.load(std::memory_order_acquire); + return {static_cast(value & ~FLAG_INHERIT), + bool(value & FLAG_INHERIT)}; + } + /** * Get the effective level for this log category. *