void logger_log()

in v2/src/logger.c [138:163]


void logger_log(LOG_LEVEL log_level, LOG_CONTEXT_HANDLE log_context, const char* file, const char* func, int line_no, const char* format, ...)
{
    if (logger_state != LOGGER_STATE_INITIALIZED)
    {
        /* Codes_SRS_LOGGER_01_017: [ If logger is not initialized, LOGGER_LOG shall abort the program. ] */
        abort();
    }
    else
    {
        va_list args;

        va_start(args, format);

        /* Codes_SRS_LOGGER_01_001: [ LOGGER_LOG shall call the log function of every sink that is configured to be used. ] */
        for (uint32_t i = 0; i < log_sink_count; i++)
        {
            va_list args_copy;

            va_copy(args_copy, args);
            log_sinks[i]->log(log_level, log_context, file, func, line_no, format, args_copy);
            va_end(args_copy);
        }

        va_end(args);
    }
}