예제 #1
0
xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
        (FILE *f, xentoollog_level min_level, unsigned flags) {
    xentoollog_logger_stdiostream newlogger;

    newlogger.f = f;
    newlogger.min_level = min_level;
    newlogger.flags = flags;

    switch (flags & (XTL_STDIOSTREAM_PROGRESS_USE_CR |
                     XTL_STDIOSTREAM_PROGRESS_NO_CR)) {
    case XTL_STDIOSTREAM_PROGRESS_USE_CR: newlogger.progress_use_cr = 1; break;
    case XTL_STDIOSTREAM_PROGRESS_NO_CR:  newlogger.progress_use_cr = 0; break;
    case 0:
        newlogger.progress_use_cr = isatty(fileno(newlogger.f)) > 0;
        break;
    default:
        errno = EINVAL;
        return 0;
    }

    if (newlogger.flags & XTL_STDIOSTREAM_SHOW_DATE) tzset();

    newlogger.progress_erase_len = 0;
    newlogger.progress_last_percent = 0;

    return XTL_NEW_LOGGER(stdiostream, newlogger);
}
예제 #2
0
파일: hyperxl.c 프로젝트: BrianMowrey/hyper
xentoollog_logger_hyperxl* xtl_createlogger_hyperxl
        (xentoollog_level min_level, unsigned flags) {
    xentoollog_logger_hyperxl newlogger;

    newlogger.min_level = min_level;
    newlogger.flags = flags;

    newlogger.log_pos = 0;

    newlogger.progress_erase_len = 0;
    newlogger.progress_last_percent = 0;

    return XTL_NEW_LOGGER(hyperxl, newlogger);
}
xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
        (FILE *f, xentoollog_level min_level, unsigned flags) {
    xentoollog_logger_stdiostream newlogger;

    newlogger.f = f;
    newlogger.min_level = min_level;
    newlogger.flags = flags;

    if (newlogger.flags & XTL_STDIOSTREAM_SHOW_DATE) tzset();

    newlogger.progress_erase_len = 0;

    return XTL_NEW_LOGGER(stdiostream, newlogger);
}
예제 #4
0
static xentoollog_logger_tellparent *createlogger_tellparent(void)
{
    xentoollog_logger_tellparent newlogger;
    return XTL_NEW_LOGGER(tellparent, newlogger);
}