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

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


Ignore:
Timestamp:
2012-08-16T15:08:19Z (9 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
dc5aa568
Parents:
32b26cf7
Message:

Set levels for individual contexts

File:
1 edited

Legend:

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

    r32b26cf7 r80d8885  
    105105}
    106106
     107int logctl_set_context_level(const char *namespace, const char *context, log_level_t new_level)
     108{
     109        async_exch_t *exchange = NULL;
     110        int rc = start_logger_exchange(&exchange);
     111        if (rc != EOK)
     112                return rc;
     113
     114        aid_t reg_msg = async_send_1(exchange, LOGGER_CTL_SET_CONTEXT_LEVEL,
     115            new_level, NULL);
     116        rc = async_data_write_start(exchange, namespace, str_size(namespace));
     117        int rc2 = async_data_write_start(exchange, context, str_size(context));
     118        sysarg_t reg_msg_rc;
     119        async_wait_for(reg_msg, &reg_msg_rc);
     120
     121        async_exchange_end(exchange);
     122
     123        if (rc != EOK)
     124                return rc;
     125
     126        if (rc2 != EOK)
     127                return rc2;
     128
     129        return (int) reg_msg_rc;
     130}
     131
     132
    107133int logctl_get_boot_level(log_level_t *level)
    108134{
Note: See TracChangeset for help on using the changeset viewer.