27 #include <core/threading/thread.h> 28 #include <utils/logging/console.h> 29 #include <utils/logging/logger.h> 30 #include <utils/logging/multi.h> 31 #include <utils/system/signal.h> 37 class LoggerQAThread :
public Thread 40 LoggerQAThread(
const char *name,
Logger *logger) :
Thread(name)
42 this->logger = logger;
50 printf(
"%s: Testing: %i\n", name(), i);
51 logger->
log_info(name(),
"Testing: %i", i);
65 t1 = t2 = t3 = t4 = t5 = t6 = NULL;
81 handle_signal(
int signum)
83 printf(
"Signal received, cancelling threads\n");
90 printf(
"Threads cancelled\n");
99 t1 =
new LoggerQAThread(
"L-1-", ml);
100 t2 =
new LoggerQAThread(
"L-2-", ml);
101 t3 =
new LoggerQAThread(
"L-3-", ml);
102 t4 =
new LoggerQAThread(
"L-4-", ml);
103 t5 =
new LoggerQAThread(
"L-5-", ml);
104 t6 =
new LoggerQAThread(
"L-6-", ml);
132 main(
int argc,
char **argv)
static void finalize()
Finalize (and free) the SignalManager instance, this does NOT implicitly delete the signal handlers,...
Interface for logging to stderr.
Fawkes library namespace.
Interface for signal handling.
Thread class encapsulation of pthreads.
Log through multiple loggers.
static SignalHandler * register_handler(int signum, SignalHandler *handler)
Register a SignalHandler for a signal.
virtual void log_info(const char *component, const char *format,...)
Log informational message.