Moved messages to message log

Moved messages to message log and others printed only with DEBUG mode
compile setting
This commit is contained in:
MassimilianoPinto
2014-11-19 11:36:44 +01:00
parent d4894b3c1d
commit ed461d58e2
2 changed files with 20 additions and 4 deletions

View File

@ -2552,6 +2552,7 @@ static bool logfile_init(
logfile_free_memory(logfile); logfile_free_memory(logfile);
goto return_with_succp; goto return_with_succp;
} }
#if defined(SS_DEBUG)
if (store_shmem) if (store_shmem)
{ {
fprintf(stderr, "%s\t: %s->%s\n", fprintf(stderr, "%s\t: %s->%s\n",
@ -2565,6 +2566,7 @@ static bool logfile_init(
STRLOGNAME(logfile_id), STRLOGNAME(logfile_id),
logfile->lf_full_file_name); logfile->lf_full_file_name);
} }
#endif
succp = true; succp = true;
logfile->lf_state = RUN; logfile->lf_state = RUN;
CHK_LOGFILE(logfile); CHK_LOGFILE(logfile);

View File

@ -391,6 +391,10 @@ static bool file_write_header(
ts1.tv_nsec = DISKWRITE_LATENCY*1000000; ts1.tv_nsec = DISKWRITE_LATENCY*1000000;
#endif #endif
#if !defined(SS_DEBUG)
return true;
#endif
if ((t = (time_t *)malloc(sizeof(time_t))) == NULL) { if ((t = (time_t *)malloc(sizeof(time_t))) == NULL) {
goto return_succp; goto return_succp;
} }
@ -1185,8 +1189,12 @@ int main(int argc, char **argv)
if (!daemon_mode) if (!daemon_mode)
{ {
fprintf(stderr, fprintf(stderr,
"Info : MaxScale will be run in the terminal process.\n See " "Info : MaxScale will be run in the terminal process.\n");
#if defined(SS_DEBUG)
fprintf(stderr,
"\tSee "
"the log from the following log files : \n\n"); "the log from the following log files : \n\n");
#endif
} }
else else
{ {
@ -1198,11 +1206,11 @@ int main(int argc, char **argv)
int eno = 0; int eno = 0;
char* fprerr = "Failed to initialize set the signal " char* fprerr = "Failed to initialize set the signal "
"set for MaxScale. Exiting."; "set for MaxScale. Exiting.";
#if defined(SS_DEBUG)
fprintf(stderr, fprintf(stderr,
"Info : MaxScale will be run in a daemon process.\n\tSee " "Info : MaxScale will be run in a daemon process.\n\tSee "
"the log from the following log files : \n\n"); "the log from the following log files : \n\n");
#endif
r = sigfillset(&sigset); r = sigfillset(&sigset);
if (r != 0) if (r != 0)
@ -1553,9 +1561,11 @@ int main(int argc, char **argv)
fprintf(stderr, fprintf(stderr,
"Home directory : %s" "Home directory : %s"
"\nConfiguration file : %s" "\nConfiguration file : %s"
"\nLog directory : %s/log"
"\nData directory : %s\n\n", "\nData directory : %s\n\n",
home_dir, home_dir,
cnf_file_path, cnf_file_path,
home_dir,
datadir); datadir);
} }
LOGIF(LM, (skygw_log_write_flush( LOGIF(LM, (skygw_log_write_flush(
@ -1566,6 +1576,10 @@ int main(int argc, char **argv)
LOGFILE_MESSAGE, LOGFILE_MESSAGE,
"Data directory : %s", "Data directory : %s",
datadir))); datadir)));
LOGIF(LM, (skygw_log_write_flush(
LOGFILE_MESSAGE,
"Log directory : %s/log",
home_dir)));
LOGIF(LM, (skygw_log_write_flush( LOGIF(LM, (skygw_log_write_flush(
LOGFILE_MESSAGE, LOGFILE_MESSAGE,
"Configuration file : %s", "Configuration file : %s",