diff --git a/include/ucore/logging.h b/include/ucore/logging.h index c63ebef..b7800ed 100644 --- a/include/ucore/logging.h +++ b/include/ucore/logging.h @@ -100,9 +100,12 @@ struct UCLogModule { int id; /** A short name for the module. + * (must point to static storage) * This will appear in log messages */ const char *short_name; - /** A longer description for the log module*/ + /** A longer description for the log module + * (must point to static storage) + */ const char *long_name; /** The log level of this module. Only * log statements with a level >= the log_level @@ -295,7 +298,7 @@ int uc_log_reopen_files(void); * * @param user_struct containing an array of all the modules defined by the application. */ -void uc_log_init(struct UCLogModules *user_modules); +void uc_log_init(const struct UCLogModules *user_modules); void uc_logf(enum UC_LOG_LEVEL log_level, int module, int raw, const char *location, const char *fmt, ...) diff --git a/src/logging.c b/src/logging.c index d85206f..c235546 100644 --- a/src/logging.c +++ b/src/logging.c @@ -459,7 +459,7 @@ int uc_log_reopen_files(void) return rc; } -void uc_log_init(struct UCLogModules *user_modules) +void uc_log_init(const struct UCLogModules *user_modules) { g_modules = *user_modules; }