Files
MaxScale/server/include/test_utils.h
Johan Wikman 55dbaa49c0 Logging target must be explicitly defined.
Whether the log-file should be written to the filesystem or to
shared memory must now be explicitly defined when calling
skygw_logmanager_init() (instead of passing that via the argc/argv
construct).

Also, the meaning of '-l' when invoking maxscale has been changed.

Earlier -l [file|shm] specified whether the trace and debug logs
should be written to shared memory (while the error and message
logs always were written to the filesystem) and the _default_
was to write them to shared memory.

Now, with only one file, '-l' has still the same meaning, but it
decides whether the one and only logfile should be written to shared
memory, or the filesystem and the _default_ is to write it to the
filesystem.
2015-11-11 13:47:34 +02:00

29 lines
501 B
C

#ifndef TEST_UTILS_H
#define TEST_UTILS_H
#include <poll.h>
#include <dcb.h>
#include <housekeeper.h>
#include <maxscale_test.h>
#include <log_manager.h>
void init_test_env(char *path)
{
int argc = 3;
const char* logdir = path ? path : TEST_LOG_DIR;
char* argv[] =
{
"log_manager",
"-l",
"LOGFILE_ERROR",
NULL
};
skygw_logmanager_init(logdir, LOG_TARGET_DEFAULT, argc, argv);
poll_init();
hkinit();
}
#endif