MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ should_log()

bool MayaFlux::Journal::Archivist::Impl::should_log ( Severity  severity,
Component  component,
Context  context 
) const
inlineprivate

Definition at line 194 of file Archivist.cpp.

195 {
196 if (severity != Severity::NONE && severity < m_min_severity.load(std::memory_order_relaxed))
197 return false;
198
199 auto comp_idx = static_cast<size_t>(component);
200 if (comp_idx >= m_component_filters.size()
201 || !m_component_filters[comp_idx].load(std::memory_order_acquire))
202 return false;
203
204 auto component_includes = m_component_includes.load(std::memory_order_acquire);
205 if (component_includes != 0 && !(component_includes & (uint64_t { 1 } << comp_idx)))
206 return false;
207
208 auto ctx_idx = static_cast<size_t>(context);
209
210 if (ctx_idx >= m_context_filters.size()
211 || !m_context_filters[ctx_idx].load(std::memory_order_acquire))
212 return false;
213
214 auto context_includes = m_context_includes.load(std::memory_order_acquire);
215 return context_includes == 0 || (context_includes & (uint64_t { 1 } << ctx_idx));
216 }
std::string severity
Definition Config.cpp:18
std::array< std::atomic< bool >, magic_enum::enum_count< Component >()> m_component_filters
std::atomic< Severity > m_min_severity
std::array< std::atomic< bool >, magic_enum::enum_count< Context >()> m_context_filters
std::atomic< uint64_t > m_context_includes
std::atomic< uint64_t > m_component_includes

References m_component_filters, m_component_includes, m_context_filters, m_context_includes, m_min_severity, MayaFlux::Journal::NONE, and severity.

Referenced by scribe(), and scribe_rt().

+ Here is the caller graph for this function: