Changeset 3d31af5 in mainline


Ignore:
Timestamp:
2011-02-04T14:02:42Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a2be824
Parents:
38648f0
Message:

Log stream flushed explicitly

Also variable renamed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/debug.c

    r38648f0 r3d31af5  
    206206void usb_log_printf(usb_log_level_t level, const char *format, ...)
    207207{
    208         FILE *stream = NULL;
     208        FILE *screen_stream = NULL;
    209209        switch (level) {
    210210                case USB_LOG_LEVEL_FATAL:
    211211                case USB_LOG_LEVEL_ERROR:
    212                         stream = stderr;
     212                        screen_stream = stderr;
    213213                        break;
    214214                default:
    215                         stream = stdout;
     215                        screen_stream = stdout;
    216216                        break;
    217217        }
    218         assert(stream != NULL);
     218        assert(screen_stream != NULL);
    219219
    220220        va_list args;
     
    233233                fprintf(log_stream, "[%s]%s: ", log_prefix, level_name);
    234234                vfprintf(log_stream, format, args);
     235                fflush(log_stream);
    235236        }
    236237
    237238        if (level <= log_level) {
    238                 fprintf(stream, "[%s]%s: ", log_prefix, level_name);
    239                 vfprintf(stream, format, args);
     239                fprintf(screen_stream, "[%s]%s: ", log_prefix, level_name);
     240                vfprintf(screen_stream, format, args);
     241                fflush(screen_stream);
    240242        }
    241243
Note: See TracChangeset for help on using the changeset viewer.