Changeset 32b26cf7 in mainline


Ignore:
Timestamp:
2012-08-16T14:23:07Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
80d8885
Parents:
793cce15
Message:

Extend logger2 test with contexts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/stdio/logger2.c

    r793cce15 r32b26cf7  
    3636const char *test_logger2(void)
    3737{
     38        log_context_t ctx_alpha = log_context_create("alpha");
     39        log_context_t ctx_bravo = log_context_create("bravo");
     40
     41        TPRINTF("Alpha context is %" PRIlogctx ".\n", ctx_alpha);
     42        TPRINTF("Bravo context is %" PRIlogctx ".\n", ctx_bravo);
     43
    3844        while (true) {
    39                 for (log_level_t level = 0; level < LVL_LIMIT; level++) {
     45                /*
     46                 * Intentionally skipping FATAL to allow muting
     47                 * the output completely by setting visible level to FATAL.
     48                 */
     49                for (log_level_t level = LVL_ERROR; level < LVL_LIMIT; level++) {
    4050                        log_msg(level, "Printing level %d (%s).",
     51                            (int) level, log_level_str(level));
     52                        log_ctx_msg(ctx_alpha, level,
     53                            "Printing level %d (%s) in alpha context.",
     54                            (int) level, log_level_str(level));
     55                        log_ctx_msg(ctx_bravo, level,
     56                            "Printing level %d (%s) in bravo context.",
    4157                            (int) level, log_level_str(level));
    4258                        async_usleep(1000 * 100);
Note: See TracChangeset for help on using the changeset viewer.