Changeset 669f5cae in mainline for uspace/srv/logger/main.c
- Timestamp:
- 2012-08-16T08:44:34Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6e9e12b
- Parents:
- cddcc4a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/logger/main.c
rcddcc4a3 r669f5cae 47 47 #include "logger.h" 48 48 49 static void connection_handler_control(void) 50 { 51 printf(NAME "/control: new client.\n"); 52 53 while (true) { 54 ipc_call_t call; 55 ipc_callid_t callid = async_get_call(&call); 56 57 if (!IPC_GET_IMETHOD(call)) 58 break; 59 60 int rc; 61 62 switch (IPC_GET_IMETHOD(call)) { 63 case LOGGER_CTL_GET_DEFAULT_LEVEL: 64 async_answer_1(callid, EOK, get_default_logging_level()); 65 break; 66 case LOGGER_CTL_SET_DEFAULT_LEVEL: 67 rc = set_default_logging_level(IPC_GET_ARG1(call)); 68 async_answer_0(callid, rc); 69 break; 70 default: 71 async_answer_0(callid, EINVAL); 72 break; 73 } 74 } 75 76 printf(NAME "/control: client terminated.\n"); 77 } 78 49 79 static logging_namespace_t *find_namespace_and_attach_writer(void) 50 80 { … … 74 104 static int handle_receive_message(logging_namespace_t *namespace, int level) 75 105 { 76 bool skip_message = (level > DEFAULT_LOGGING_LEVEL) && !namespace_has_reader(namespace, level);106 bool skip_message = (level > (int)get_default_logging_level()) && !namespace_has_reader(namespace, level); 77 107 if (skip_message) { 78 108 /* Abort the actual message buffer transfer. */ … … 221 251 222 252 switch (iface) { 253 case LOGGER_INTERFACE_CONTROL: 254 async_answer_0(iid, EOK); 255 connection_handler_control(); 256 break; 223 257 case LOGGER_INTERFACE_SINK: 224 258 /* First call has to be the registration. */
Note:
See TracChangeset
for help on using the changeset viewer.