void print_log()

in cli/bpfcov.c [824:862]


void print_log(int level, const char *prefix, struct root_args *args, const char *fmt, ...)
{
    if (args->verbosity < level)
    {
        return;
    }

    FILE *f = level == 0 ? stderr : stdout;
    va_list argptr;
    va_start(argptr, fmt);

    if (!prefix || (prefix && !*prefix))
    {
        goto without_prefix;
    }

    char *category = "unkn";
    switch (level)
    {
    case 0:
        category = "erro";
        break;
    case 1:
        category = "warn";
        break;
    case 2:
        category = "info";
        break;
    case 3:
        category = "debu";
        break;
    }

    fprintf(f, "%s: %s: ", TOOL_NAME, category);

without_prefix:
    vfprintf(f, fmt, argptr);
    va_end(argptr);
}