32 lines
911 B
C++
32 lines
911 B
C++
#include "init_spark_lib.h"
|
|
#include "lib/logging/logging.h"
|
|
#include "lib/utils/bts_assert.h"
|
|
#include "lib/utils/thread_manager.h"
|
|
|
|
namespace bts {
|
|
namespace utils {
|
|
|
|
static log::LoggingConfigPoller *poller = nullptr;
|
|
|
|
void init_spark_lib() {
|
|
// Write to stdout instead of normal log, because the logging system hasn't
|
|
// been configured yet (that's one of the things we're about to do).
|
|
std::cout << "Initializing spark_lib\n";
|
|
std::cout << "Configuring thread 'main'" << std::endl;
|
|
threading::configure_current_thread("main");
|
|
std::cout << "Starting default logging thread" << std::endl;
|
|
log::start_default_logging_thread();
|
|
std::cout << "Initializing LoggingConfigPoller" << std::endl;
|
|
poller = new log::LoggingConfigPoller();
|
|
}
|
|
|
|
void finit_spark_lib() {
|
|
LOG(Gen, Diag, "finit_spark_lib");
|
|
if (poller) {
|
|
delete poller;
|
|
}
|
|
}
|
|
|
|
} // namespace utils
|
|
} // namespace bts
|