Remove output on stdout by default on daemon startuip

This commit is contained in:
matt335672
2020-12-28 11:03:36 +00:00
parent cca057908c
commit 1e13533048
8 changed files with 51 additions and 31 deletions
+4 -3
View File
@@ -304,7 +304,7 @@ internal_config_read_logging(int file,
lc->console_level = LOG_LEVEL_INFO;
lc->enable_syslog = 0;
lc->syslog_level = LOG_LEVEL_INFO;
lc->dump_on_start = 1;
lc->dump_on_start = 0;
lc->enable_pid = 0;
g_snprintf(section_name, 511, "%s%s", section_prefix, SESMAN_CFG_LOGGING);
@@ -616,7 +616,6 @@ log_config_init_for_console(enum logLevels lvl, const char *override_name)
{
config->console_level = lvl;
}
config->dump_on_start = 0; /* Don't need dump for console only */
}
return config;
}
@@ -721,7 +720,8 @@ log_start_from_param(const struct log_config *src_log_config)
* @return 0 on success
*/
enum logReturns
log_start(const char *iniFile, const char *applicationName)
log_start(const char *iniFile, const char *applicationName,
bool_t dump_on_start)
{
enum logReturns ret = LOG_GENERAL_ERROR;
struct log_config *config;
@@ -730,6 +730,7 @@ log_start(const char *iniFile, const char *applicationName)
if (config != NULL)
{
config->dump_on_start = dump_on_start;
ret = log_start_from_param(config);
log_config_free(config);
+6 -2
View File
@@ -263,11 +263,15 @@ internal_log_location_overrides_level(const char *function_name,
* This function initialize the log facilities according to the configuration
* file, that is described by the in parameter.
* @param iniFile
* @param applicationName, the name that is used in the log for the running application
* @param applicationName the name that is used in the log for the running
* application
* @param dump_on_start Whether to dump the config on stdout before
* logging is started
* @return LOG_STARTUP_OK on success
*/
enum logReturns
log_start(const char *iniFile, const char *applicationName);
log_start(const char *iniFile, const char *applicationName,
bool_t dump_on_start);
/**
* An alternative log_start where the caller gives the params directly.