Log: skygw_logmanager_init renamed to mxs_log_init.

skygw_logmanager_init renamed to mxs_log_init and skygw_logmanager_done
renamed to mxs_log_finish. skygw_logmanager_exit removed alltogether as
all it did was to call skygw_logmanager_done. That appears to have been
a source for confusion as in many places a call to skygw_logmanager_done
was followed by a call to skygw_logmanager_exit. In addition, the function
skygw_log_done was removed from the header, since it lacked an
implementation.
This commit is contained in:
Johan Wikman
2015-11-12 10:15:50 +02:00
parent 680345d374
commit c7a329e43e
14 changed files with 65 additions and 84 deletions

View File

@ -439,7 +439,7 @@ return_succ:
* @return true if succeed, otherwise false * @return true if succeed, otherwise false
* *
*/ */
bool skygw_logmanager_init(const char* ident, const char* logdir, log_target_t target) bool mxs_log_init(const char* ident, const char* logdir, log_target_t target)
{ {
bool succ = false; bool succ = false;
@ -504,22 +504,13 @@ static void logmanager_done_nomutex(void)
lm = NULL; lm = NULL;
} }
/**
* This function is provided for atexit() system function.
*/
void skygw_logmanager_exit(void)
{
skygw_logmanager_done();
}
/** /**
* End execution of log manager * End execution of log manager
* *
* Stops file writing thread, releases filewriter, and logfiles. * Stops file writing thread, releases filewriter, and logfiles.
* *
*/ */
void skygw_logmanager_done(void) void mxs_log_finish(void)
{ {
acquire_lock(&lmlock); acquire_lock(&lmlock);

View File

@ -138,6 +138,9 @@ extern int lm_enabled_logfiles_bitmask;
extern ssize_t log_ses_count[]; extern ssize_t log_ses_count[];
extern __thread log_info_t tls_log_info; extern __thread log_info_t tls_log_info;
bool mxs_log_init(const char* ident, const char* logdir, log_target_t target);
void mxs_log_finish(void);
int mxs_log_flush(); int mxs_log_flush();
int mxs_log_rotate(); int mxs_log_rotate();
int mxs_log_enable_priority(int priority); int mxs_log_enable_priority(int priority);
@ -147,16 +150,9 @@ int mxs_log_message(int priority,
const char* file, int line, const char* function, const char* file, int line, const char* function,
const char* format, ...); const char* format, ...);
bool skygw_logmanager_init(const char* ident,
const char* logdir,
log_target_t target);
void skygw_logmanager_done(void);
void skygw_logmanager_exit(void);
/** /**
* free private write buffer list * free private write buffer list
*/ */
void skygw_log_done(void);
int skygw_log_flush(logfile_id_t id); int skygw_log_flush(logfile_id_t id);
void skygw_log_sync_all(void); void skygw_log_sync_all(void);
int skygw_log_enable(logfile_id_t id); int skygw_log_enable(logfile_id_t id);

View File

@ -113,14 +113,14 @@ int main(int argc, char* argv[])
err = 1; err = 1;
goto return_err; goto return_err;
} }
i = atexit(skygw_logmanager_exit); i = atexit(mxs_log_finish);
if (i != 0) if (i != 0)
{ {
fprintf(stderr, "Couldn't register exit function.\n"); fprintf(stderr, "Couldn't register exit function.\n");
} }
succp = skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); succp = mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
if (!succp) if (!succp)
{ {
@ -139,7 +139,7 @@ int main(int argc, char* argv[])
tm.tm_min, tm.tm_min,
tm.tm_sec); tm.tm_sec);
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("First write with flush."); logstr = ("First write with flush.");
err = skygw_log_write_flush(LOGFILE_ERROR, logstr); err = skygw_log_write_flush(LOGFILE_ERROR, logstr);
@ -170,7 +170,7 @@ int main(int argc, char* argv[])
#endif #endif
logstr = "My name is Stacey %s"; logstr = "My name is Stacey %s";
err = skygw_log_write_flush(LOGFILE_TRACE, logstr, " "); err = skygw_log_write_flush(LOGFILE_TRACE, logstr, " ");
skygw_logmanager_done(); mxs_log_finish();
#if !defined(SS_DEBUG) #if !defined(SS_DEBUG)
skygw_log_enable(LOGFILE_TRACE); skygw_log_enable(LOGFILE_TRACE);
#endif #endif
@ -187,7 +187,7 @@ int main(int argc, char* argv[])
logstr = "Ph%dlip."; logstr = "Ph%dlip.";
err = skygw_log_write(LOGFILE_TRACE, logstr, 1); err = skygw_log_write(LOGFILE_TRACE, logstr, 1);
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("A terrible error has occurred!"); logstr = ("A terrible error has occurred!");
err = skygw_log_write_flush(LOGFILE_ERROR, logstr); err = skygw_log_write_flush(LOGFILE_ERROR, logstr);
@ -209,7 +209,7 @@ int main(int argc, char* argv[])
"with us. Just me and my mom - and you, of course. Then, if you wish, we could " "with us. Just me and my mom - and you, of course. Then, if you wish, we could "
"listen to the radio and keep company for our little Steven, my mom's cat, you know."); "listen to the radio and keep company for our little Steven, my mom's cat, you know.");
err = skygw_log_write(LOGFILE_MESSAGE, logstr); err = skygw_log_write(LOGFILE_MESSAGE, logstr);
skygw_logmanager_done(); mxs_log_finish();
#if defined(TEST1) #if defined(TEST1)
mes = skygw_message_init(); mes = skygw_message_init();
@ -252,7 +252,7 @@ int main(int argc, char* argv[])
pthread_join(thr[i]->tid, NULL); pthread_join(thr[i]->tid, NULL);
} }
/** This is to release memory */ /** This is to release memory */
skygw_logmanager_done(); mxs_log_finish();
simple_mutex_unlock(mtx); simple_mutex_unlock(mtx);
@ -309,7 +309,7 @@ int main(int argc, char* argv[])
pthread_join(thr[i]->tid, NULL); pthread_join(thr[i]->tid, NULL);
} }
/** This is to release memory */ /** This is to release memory */
skygw_logmanager_done(); mxs_log_finish();
simple_mutex_unlock(mtx); simple_mutex_unlock(mtx);
@ -333,7 +333,7 @@ int main(int argc, char* argv[])
#if !defined(SS_DEBUG) #if !defined(SS_DEBUG)
skygw_log_enable(LOGFILE_TRACE); skygw_log_enable(LOGFILE_TRACE);
#endif #endif
succp = skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); succp = mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
ss_dassert(succp); ss_dassert(succp);
logstr = ("\tTEST 3 - test enabling and disabling logs."); logstr = ("\tTEST 3 - test enabling and disabling logs.");
@ -393,12 +393,12 @@ int main(int argc, char* argv[])
err = skygw_log_write(LOGFILE_ERROR, logstr); err = skygw_log_write(LOGFILE_ERROR, logstr);
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
#endif /* TEST 3 */ #endif /* TEST 3 */
#if defined(TEST4) #if defined(TEST4)
succp = skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); succp = mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
ss_dassert(succp); ss_dassert(succp);
#if !defined(SS_DEBUG) #if !defined(SS_DEBUG)
skygw_log_enable(LOGFILE_TRACE); skygw_log_enable(LOGFILE_TRACE);
@ -432,9 +432,9 @@ int main(int argc, char* argv[])
err = skygw_log_write(LOGFILE_MESSAGE, logstr); err = skygw_log_write(LOGFILE_MESSAGE, logstr);
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
succp = skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); succp = mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
ss_dassert(succp); ss_dassert(succp);
#if !defined(SS_DEBUG) #if !defined(SS_DEBUG)
skygw_log_enable(LOGFILE_TRACE); skygw_log_enable(LOGFILE_TRACE);
@ -488,7 +488,7 @@ int main(int argc, char* argv[])
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
#endif /* TEST 4 */ #endif /* TEST 4 */
fprintf(stderr, ".. done.\n"); fprintf(stderr, ".. done.\n");
@ -507,7 +507,7 @@ static void* thr_run(void* data)
char* logstr; char* logstr;
int err; int err;
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
skygw_log_flush(LOGFILE_MESSAGE); skygw_log_flush(LOGFILE_MESSAGE);
logstr = ("Hi, how are you?"); logstr = ("Hi, how are you?");
err = skygw_log_write(LOGFILE_MESSAGE, logstr); err = skygw_log_write(LOGFILE_MESSAGE, logstr);
@ -517,7 +517,7 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
skygw_log_flush(LOGFILE_TRACE); skygw_log_flush(LOGFILE_TRACE);
skygw_log_flush(LOGFILE_MESSAGE); skygw_log_flush(LOGFILE_MESSAGE);
logstr = ("I was wondering, you know, it has been such a lovely weather whole morning and " logstr = ("I was wondering, you know, it has been such a lovely weather whole morning and "
@ -531,7 +531,7 @@ static void* thr_run(void* data)
} }
ss_dassert(err == 0); ss_dassert(err == 0);
err = skygw_log_write(LOGFILE_MESSAGE, logstr); err = skygw_log_write(LOGFILE_MESSAGE, logstr);
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("Testing. One, two, three\n"); logstr = ("Testing. One, two, three\n");
err = skygw_log_write(LOGFILE_ERROR, logstr); err = skygw_log_write(LOGFILE_ERROR, logstr);
if (err != 0) if (err != 0)
@ -539,8 +539,8 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
skygw_log_flush(LOGFILE_ERROR); skygw_log_flush(LOGFILE_ERROR);
logstr = ("For automatic and register variables, it is done each time the function or block is entered."); logstr = ("For automatic and register variables, it is done each time the function or block is entered.");
@ -553,8 +553,8 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("Rather more surprising, at least at first sight, is the fact that a reference " logstr = ("Rather more surprising, at least at first sight, is the fact that a reference "
"to a[i] can also be written as *(a+i). In evaluating a[i], C converts it to *(a+i) " "to a[i] can also be written as *(a+i). In evaluating a[i], C converts it to *(a+i) "
"immediately; the two forms are equivalent. Applying the operatos & to both parts " "immediately; the two forms are equivalent. Applying the operatos & to both parts "
@ -566,11 +566,11 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
skygw_logmanager_done(); mxs_log_finish();
skygw_log_flush(LOGFILE_ERROR); skygw_log_flush(LOGFILE_ERROR);
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("..and you?"); logstr = ("..and you?");
err = skygw_log_write(LOGFILE_MESSAGE, logstr); err = skygw_log_write(LOGFILE_MESSAGE, logstr);
if (err != 0) if (err != 0)
@ -578,8 +578,8 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("For automatic and register variables, it is done each time the function or block is entered."); logstr = ("For automatic and register variables, it is done each time the function or block is entered.");
#if !defined(SS_DEBUG) #if !defined(SS_DEBUG)
skygw_log_enable(LOGFILE_TRACE); skygw_log_enable(LOGFILE_TRACE);
@ -590,7 +590,7 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("Rather more surprising, at least at first sight, is the fact that a reference to " logstr = ("Rather more surprising, at least at first sight, is the fact that a reference to "
"a[i] can also be written as *(a+i). In evaluating a[i], C converts it to *(a+i) " "a[i] can also be written as *(a+i). In evaluating a[i], C converts it to *(a+i) "
"immediately; the two forms are equivalent. Applying the operatos & to both parts " "immediately; the two forms are equivalent. Applying the operatos & to both parts "
@ -602,7 +602,7 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("..... and you too?"); logstr = ("..... and you too?");
err = skygw_log_write(LOGFILE_MESSAGE, logstr); err = skygw_log_write(LOGFILE_MESSAGE, logstr);
if (err != 0) if (err != 0)
@ -610,8 +610,8 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
#if !defined(SS_DEBUG) #if !defined(SS_DEBUG)
skygw_log_enable(LOGFILE_TRACE); skygw_log_enable(LOGFILE_TRACE);
#endif #endif
@ -626,8 +626,8 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("Testing. One, two, three, four\n"); logstr = ("Testing. One, two, three, four\n");
err = skygw_log_write(LOGFILE_ERROR, logstr); err = skygw_log_write(LOGFILE_ERROR, logstr);
if (err != 0) if (err != 0)
@ -635,8 +635,8 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
logstr = ("Testing. One, two, three, .. where was I?\n"); logstr = ("Testing. One, two, three, .. where was I?\n");
err = skygw_log_write(LOGFILE_ERROR, logstr); err = skygw_log_write(LOGFILE_ERROR, logstr);
if (err != 0) if (err != 0)
@ -644,9 +644,9 @@ static void* thr_run(void* data)
TEST_ERROR("Error, log write failed."); TEST_ERROR("Error, log write failed.");
} }
ss_dassert(err == 0); ss_dassert(err == 0);
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_init(NULL, "/tmp", LOG_TARGET_FS); mxs_log_init(NULL, "/tmp", LOG_TARGET_FS);
skygw_logmanager_done(); mxs_log_finish();
simple_mutex_lock(td->mtx, true); simple_mutex_lock(td->mtx, true);
*td->nactive -= 1; *td->nactive -= 1;
simple_mutex_unlock(td->mtx); simple_mutex_unlock(td->mtx);

View File

@ -67,7 +67,7 @@ int main(int argc, char** argv)
iterations = atoi(argv[1]); iterations = atoi(argv[1]);
interval = atoi(argv[2]); interval = atoi(argv[2]);
succp = skygw_logmanager_init(NULL, tmp, LOG_TARGET_FS); succp = mxs_log_init(NULL, tmp, LOG_TARGET_FS);
if (!succp) if (!succp)
{ {
@ -108,7 +108,7 @@ int main(int argc, char** argv)
} }
skygw_log_flush(LOGFILE_ERROR); skygw_log_flush(LOGFILE_ERROR);
skygw_logmanager_done(); mxs_log_finish();
free(message); free(message);
return 0; return 0;
} }

View File

@ -1081,10 +1081,7 @@ int main(int argc, char **argv)
sigset_t sigset; sigset_t sigset;
sigset_t sigpipe_mask; sigset_t sigpipe_mask;
sigset_t saved_mask; sigset_t saved_mask;
void (*exitfunp[4])(void) = {skygw_logmanager_exit, void (*exitfunp[4])(void) = { mxs_log_finish, datadir_cleanup, write_footer, NULL };
datadir_cleanup,
write_footer,
NULL};
*syslog_enabled = 1; *syslog_enabled = 1;
*maxscalelog_enabled = 1; *maxscalelog_enabled = 1;
@ -1719,7 +1716,7 @@ int main(int argc, char **argv)
logmanager_enable_syslog(*syslog_enabled); logmanager_enable_syslog(*syslog_enabled);
logmanager_enable_maxscalelog(*maxscalelog_enabled); logmanager_enable_maxscalelog(*maxscalelog_enabled);
succp = skygw_logmanager_init(NULL, get_logdir(), log_target); succp = mxs_log_init(NULL, get_logdir(), log_target);
if (!succp) if (!succp)
{ {

View File

@ -48,7 +48,7 @@ int main(int argc, char **argv)
keyfile = argv[1]; keyfile = argv[1];
} }
skygw_logmanager_init(NULL, NULL, LOG_TARGET_DEFAULT); mxs_log_init(NULL, NULL, LOG_TARGET_DEFAULT);
if (secrets_writeKeys(keyfile)) if (secrets_writeKeys(keyfile))
{ {
@ -57,7 +57,7 @@ int main(int argc, char **argv)
} }
skygw_log_sync_all(); skygw_log_sync_all();
skygw_logmanager_done(); mxs_log_finish();
return rval; return rval;
} }

View File

@ -51,7 +51,7 @@ main(int argc, char **argv)
return 1; return 1;
} }
skygw_logmanager_init(NULL, NULL, LOG_TARGET_DEFAULT); mxs_log_init(NULL, NULL, LOG_TARGET_DEFAULT);
pw = calloc(81, sizeof(char)); pw = calloc(81, sizeof(char));
@ -75,6 +75,6 @@ main(int argc, char **argv)
free(pw); free(pw);
skygw_log_sync_all(); skygw_log_sync_all();
skygw_logmanager_done(); mxs_log_finish();
return rval; return rval;
} }

View File

@ -12,7 +12,7 @@ void init_test_env(char *path)
const char* logdir = path ? path : TEST_LOG_DIR; const char* logdir = path ? path : TEST_LOG_DIR;
skygw_logmanager_init(NULL, logdir, LOG_TARGET_DEFAULT); mxs_log_init(NULL, logdir, LOG_TARGET_DEFAULT);
poll_init(); poll_init();
hkinit(); hkinit();
} }

View File

@ -2213,7 +2213,7 @@ int main(int argc, char** argv)
NULL NULL
}; };
skygw_logmanager_init(argc_,argv_); mxs_log_init(argc_,argv_);
init_test_env(home); init_test_env(home);

View File

@ -17,7 +17,7 @@ int harness_init(int argc, char** argv, HARNESS_INSTANCE** inst){
char tmp[2048]; char tmp[2048];
if(!(argc == 2 && strcmp(argv[1],"-h") == 0)){ if(!(argc == 2 && strcmp(argv[1],"-h") == 0)){
skygw_logmanager_init(NULL,NULL,LOG_TARGET_DEFAULT); mxs_log_init(NULL,NULL,LOG_TARGET_DEFAULT);
} }
if(!(instance.head = calloc(1,sizeof(FILTERCHAIN)))) if(!(instance.head = calloc(1,sizeof(FILTERCHAIN))))
@ -51,7 +51,7 @@ int harness_init(int argc, char** argv, HARNESS_INSTANCE** inst){
getcwd(cwd,sizeof(cwd)); getcwd(cwd,sizeof(cwd));
sprintf(tmp,"%s",cwd); sprintf(tmp,"%s",cwd);
skygw_logmanager_init(NULL, tmp, LOG_TARGET_DEFAULT); mxs_log_init(NULL, tmp, LOG_TARGET_DEFAULT);
rval = process_opts(argc,argv); rval = process_opts(argc,argv);

View File

@ -11,8 +11,7 @@ int main(int argc, char** argv){
if(harness_init(argc,argv,&hinstance)){ if(harness_init(argc,argv,&hinstance)){
printf("Error: Initialization failed.\n"); printf("Error: Initialization failed.\n");
skygw_log_write(LOGFILE_ERROR,"Error: Initialization failed.\n"); skygw_log_write(LOGFILE_ERROR,"Error: Initialization failed.\n");
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_exit();
return 1; return 1;
} }
@ -230,8 +229,7 @@ int main(int argc, char** argv){
free_buffers(); free_buffers();
free_filters(); free_filters();
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_exit();
free(instance.head); free(instance.head);
return 0; return 0;

View File

@ -35,8 +35,7 @@ int main(int argc,char** argv)
if(harness_init(argc,argv,&inst) || inst->error){ if(harness_init(argc,argv,&inst) || inst->error){
printf("Error: Initialization failed.\n"); printf("Error: Initialization failed.\n");
skygw_log_write(LOGFILE_ERROR,"Error: Initialization failed.\n"); skygw_log_write(LOGFILE_ERROR,"Error: Initialization failed.\n");
skygw_logmanager_done(); mxs_log_finish();
skygw_logmanager_exit();
return 1; return 1;
} }

View File

@ -124,7 +124,7 @@ int main(int argc, char **argv) {
num_args = optind; num_args = optind;
skygw_logmanager_init(NULL, NULL, LOG_TARGET_DEFAULT); mxs_log_init(NULL, NULL, LOG_TARGET_DEFAULT);
skygw_log_set_augmentation(0); skygw_log_set_augmentation(0);
@ -138,7 +138,7 @@ int main(int argc, char **argv) {
"Error: Memory allocation failed for ROUTER_INSTANCE"))); "Error: Memory allocation failed for ROUTER_INSTANCE")));
skygw_log_sync_all(); skygw_log_sync_all();
skygw_logmanager_done(); mxs_log_finish();
return 1; return 1;
} }
@ -162,7 +162,7 @@ int main(int argc, char **argv) {
path, strerror(errno)))); path, strerror(errno))));
skygw_log_sync_all(); skygw_log_sync_all();
skygw_logmanager_done(); mxs_log_finish();
free(inst); free(inst);
@ -200,7 +200,7 @@ int main(int argc, char **argv) {
"Check retcode: %i, Binlog Pos = %llu", ret, inst->binlog_position))); "Check retcode: %i, Binlog Pos = %llu", ret, inst->binlog_position)));
skygw_log_sync_all(); skygw_log_sync_all();
skygw_logmanager_done(); mxs_log_finish();
free(inst); free(inst);

View File

@ -89,7 +89,7 @@ int main(int argc, char **argv) {
roptions = strdup("server-id=3,heartbeat=200,binlogdir=/not_exists/my_dir,transaction_safety=1,master_version=5.6.99-common,master_hostname=common_server,master_uuid=xxx-fff-cccc-fff,master-id=999"); roptions = strdup("server-id=3,heartbeat=200,binlogdir=/not_exists/my_dir,transaction_safety=1,master_version=5.6.99-common,master_hostname=common_server,master_uuid=xxx-fff-cccc-fff,master-id=999");
skygw_logmanager_init(NULL, NULL, LOG_TARGET_DEFAULT); mxs_log_init(NULL, NULL, LOG_TARGET_DEFAULT);
skygw_log_disable(LOGFILE_DEBUG); skygw_log_disable(LOGFILE_DEBUG);
skygw_log_disable(LOGFILE_TRACE); skygw_log_disable(LOGFILE_TRACE);
@ -128,7 +128,7 @@ int main(int argc, char **argv) {
"Error: Memory allocation FAILED for ROUTER_INSTANCE"))); "Error: Memory allocation FAILED for ROUTER_INSTANCE")));
skygw_log_sync_all(); skygw_log_sync_all();
skygw_logmanager_done(); mxs_log_finish();
return 1; return 1;
} }
@ -579,7 +579,7 @@ int main(int argc, char **argv) {
} }
skygw_log_sync_all(); skygw_log_sync_all();
skygw_logmanager_done(); mxs_log_finish();
free(inst); free(inst);