Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset eab3d04 in mainline for uspace/lib/c/generic/io/logctl.c


Ignore:
Timestamp:
2012-08-16T11:36:54Z (9 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
494f417
Parents:
1c67b41
Message:

Allow specifying of log level as a name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/logctl.c

    r1c67b41 reab3d04  
    8484                return EINVAL;
    8585
    86         char level_str[10];
    87         str_cpy(level_str, 10, (const char *) argument);
     86        char level_str[20];
     87        str_cpy(level_str, 20, (const char *) argument);
    8888
    89         int level_int = strtol(level_str, NULL, 0);
    90 
    91         log_level_t boot_level = (log_level_t) level_int;
    92         if (boot_level >= LVL_LIMIT)
    93                 return EINVAL;
     89        log_level_t boot_level;
     90        int rc = log_level_from_str(level_str, &boot_level);
     91        if (rc != EOK)
     92                return rc;
    9493
    9594        if (level != NULL)
Note: See TracChangeset for help on using the changeset viewer.