FastLED 3.9.15
Loading...
Searching...
No Matches

◆ get_async_logger_by_index()

template<fl::size N, typename InfoProvider>
AsyncLogger & fl::get_async_logger_by_index ( )
inline

Template-based logger accessor with auto-registration and enablement check.

Template Parameters
NLogger index (0-15, maps to Singleton<AsyncLogger, N>)
InfoProviderType providing category name and define name via static methods
Returns
Reference to AsyncLogger singleton instance
Note
Only instantiated template indices are compiled - linker removes unused ones
Prints error message once if logging is disabled for this category

Definition at line 249 of file async_logger.h.

249 {
250 // Get singleton instance (only this specific N is instantiated)
251 static AsyncLogger* logger_ptr = []() {
254
255 // Auto-instantiate service task on first logger access
256 // This ensures automatic background servicing via fl::delay() and fl::task::Scheduler
258
259 return ptr;
260 }();
261
262 // Check if logging is enabled, print error once if not
263 // (Implementation in async_logger.cpp.hpp uses FL_ERROR)
265
266 return *logger_ptr;
267}
ISR-safe async logger wrapper (zero heap allocation) Uses embedded AsyncLogQueue instead of heap-allo...
static T & instance() FL_NOEXCEPT
Definition singleton.h:81
static AsyncLoggerServiceTask & instance()
void checkLoggerEnabled()
Check if logger is enabled and print error once if not.
static ActiveLoggerRegistry & instance()
void registerLogger(AsyncLogger *logger)

References fl::detail::checkLoggerEnabled(), get_async_logger_by_index(), fl::detail::ActiveLoggerRegistry::instance(), fl::detail::AsyncLoggerServiceTask::instance(), and fl::SingletonShared< T, N >::instance().

Referenced by get_async_logger_by_index(), get_audio_async_logger_isr(), get_audio_async_logger_main(), get_flexio_async_logger_isr(), get_flexio_async_logger_main(), get_interrupt_async_logger_isr(), get_interrupt_async_logger_main(), get_objectfled_async_logger_isr(), get_objectfled_async_logger_main(), get_parlio_async_logger_isr(), get_parlio_async_logger_main(), get_rmt_async_logger_isr(), get_rmt_async_logger_main(), get_spi_async_logger_isr(), and get_spi_async_logger_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: