Changeset b52dd1de in mainline
- Timestamp:
- 2012-08-16T09:39:07Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5882487
- Parents:
- 0a6a996
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/logctl.c
r0a6a996 rb52dd1de 36 36 #include <io/logctl.h> 37 37 #include <ipc/logger.h> 38 #include <sysinfo.h> 38 39 #include <ns.h> 40 41 #define SYSINFO_DEFAULT_LOG_LEVEL "logger.level" 39 42 40 43 /** IPC session with the logger service. */ … … 73 76 } 74 77 78 int logctl_get_boot_level(log_level_t *level) 79 { 80 sysarg_t boot_level_arg; 81 int rc = sysinfo_get_value(SYSINFO_DEFAULT_LOG_LEVEL, &boot_level_arg); 82 if (rc != EOK) 83 return rc; 84 85 log_level_t boot_level = (log_level_t) boot_level_arg; 86 if (boot_level >= LVL_LIMIT) 87 return EINVAL; 88 89 if (level != NULL) 90 *level = (log_level_t) boot_level; 91 92 return EOK; 93 } 94 75 95 /** @} 76 96 */ -
uspace/lib/c/include/io/logctl.h
r0a6a996 rb52dd1de 37 37 38 38 extern int logctl_set_default_level(log_level_t); 39 extern int logctl_get_boot_level(log_level_t *); 39 40 40 41 #endif -
uspace/srv/logger/main.c
r0a6a996 rb52dd1de 39 39 #include <ipc/logger.h> 40 40 #include <io/log.h> 41 #include <io/logctl.h> 41 42 #include <ns.h> 42 43 #include <async.h> … … 189 190 printf(NAME ": HelenOS Logging Service\n"); 190 191 192 /* Get default logging level from sysinfo (if available). */ 193 log_level_t boot_logging_level = LVL_NOTE; 194 int rc = logctl_get_boot_level(&boot_logging_level); 195 if (rc == EOK) 196 set_default_logging_level(boot_logging_level); 197 else 198 printf(NAME ": Warn: failed to get logging level from sysinfo: %s.\n", 199 str_error(rc)); 200 191 201 async_set_client_connection(connection_handler); 192 202 193 intrc = service_register(SERVICE_LOGGER);203 rc = service_register(SERVICE_LOGGER); 194 204 if (rc != EOK) { 195 205 printf(NAME ": failed to register: %s.\n", str_error(rc));
Note:
See TracChangeset
for help on using the changeset viewer.