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

Changeset cba45af in mainline for uspace/lib/c/generic/io/log.c


Ignore:
Timestamp:
2012-08-16T21:01:55Z (9 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
2bf781a
Parents:
e005f92
Message:

Rewrite logger (work in progress)

Major issues

  • no locking
  • no clean-up (at all)
File:
1 edited

Legend:

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

    re005f92 rcba45af  
    6262#define MESSAGE_BUFFER_SIZE 4096
    6363
     64static sysarg_t toplog_id;
     65
    6466static int logger_register(async_sess_t *session, const char *prog_name)
    6567{
     
    6971        }
    7072
    71         aid_t reg_msg = async_send_0(exchange, LOGGER_REGISTER, NULL);
     73        ipc_call_t answer;
     74        aid_t reg_msg = async_send_0(exchange, LOGGER_WRITER_CREATE_TOPLEVEL_LOG, &answer);
    7275        int rc = async_data_write_start(exchange, prog_name, str_size(prog_name));
    7376        sysarg_t reg_msg_rc;
     
    8083        }
    8184
    82         return reg_msg_rc;
     85        if (reg_msg_rc != EOK)
     86                return reg_msg_rc;
     87
     88        toplog_id = IPC_GET_ARG1(answer);
     89
     90        return EOK;
    8391}
    8492
     
    9098        }
    9199
    92         aid_t reg_msg = async_send_2(exchange, LOGGER_MESSAGE,
    93             ctx, level, NULL);
     100        aid_t reg_msg = async_send_3(exchange, LOGGER_WRITER_MESSAGE,
     101            toplog_id, ctx, level, NULL);
    94102        int rc = async_data_write_start(exchange, message, str_size(message));
    95103        sysarg_t reg_msg_rc;
     
    183191
    184192        ipc_call_t answer;
    185         aid_t reg_msg = async_send_0(exchange, LOGGER_CREATE_CONTEXT, &answer);
     193        aid_t reg_msg = async_send_1(exchange, LOGGER_WRITER_CREATE_SUB_LOG, toplog_id, &answer);
    186194        int rc = async_data_write_start(exchange, name, str_size(name));
    187195        sysarg_t reg_msg_rc;
Note: See TracChangeset for help on using the changeset viewer.