From: Andre Noll Date: Mon, 15 Dec 2014 19:20:44 +0000 (+0100) Subject: daemon: Improve daemon_log_welcome(). X-Git-Tag: v0.5.5~26 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=ce231275f1e5368aca092cf207bba8fe58015822 daemon: Improve daemon_log_welcome(). This function is used within para_server and para_audiod. Adding the "para_" prefix in daemon_log_welcome() rather than its callers avoids the duplication. Also rename the "whoami" parameter to "name" and add documentation for it. Finally, the build date is not really important in the log message, so simply remove it. --- diff --git a/audiod.c b/audiod.c index 40443a61..accf0244 100644 --- a/audiod.c +++ b/audiod.c @@ -1493,7 +1493,7 @@ int main(int argc, char *argv[]) PARA_EMERG_LOG("%s\n", para_strerror(-ret)); exit(EXIT_FAILURE); } - daemon_log_welcome("para_audiod"); + daemon_log_welcome("audiod"); daemon_set_start_time(); set_initial_status(); FOR_EACH_SLOT(i) diff --git a/daemon.c b/daemon.c index ca745956..94c4a8cb 100644 --- a/daemon.c +++ b/daemon.c @@ -249,11 +249,15 @@ void daemon_open_log_or_die(void) /** * Log the startup message containing the paraslash version. + * + * \param name The name of the executable. + * + * First the given \a name is prefixed with the string "para_". Next the git + * version is appended. The resulting string is logged with priority "INFO". */ -void daemon_log_welcome(const char *whoami) +void daemon_log_welcome(const char *name) { - PARA_INFO_LOG("welcome to %s " PACKAGE_VERSION " ("BUILD_DATE")\n", - whoami); + PARA_INFO_LOG("welcome to para_%s-" PACKAGE_VERSION " \n", name); } /** diff --git a/server.c b/server.c index 9104c5aa..3118a3a0 100644 --- a/server.c +++ b/server.c @@ -466,7 +466,7 @@ static void server_init(int argc, char **argv) daemon_drop_privileges_or_die(conf.user_arg, conf.group_arg); /* parse config file, open log and set defaults */ parse_config_or_die(0); - daemon_log_welcome("para_server"); + daemon_log_welcome("server"); init_ipc_or_die(); /* init mmd struct and mmd->lock */ daemon_set_start_time(); init_user_list(user_list_file);