Exemplo n.º 1
0
std::tuple<std::shared_ptr<terrama2::core::DataManager>, std::shared_ptr<terrama2::core::Service>, std::shared_ptr<terrama2::core::ProcessLogger> >
createCollector()
{
  auto dataManager = std::make_shared<terrama2::services::collector::core::DataManager>();
  auto service = std::make_shared<terrama2::services::collector::core::Service>(dataManager);
  auto logger = std::make_shared<terrama2::services::collector::core::CollectorLogger>();

  service->setLogger(logger);

  return std::make_tuple(dataManager, service, logger);
}
Exemplo n.º 2
0
void HttpListener::endConfig()
{
    m_pMapVHost->endConfig();
    if ( m_pSubIpMap )
        m_pSubIpMap->endConfig();
    if ( m_pMapVHost->getDedicated() )
        setLogger( m_pMapVHost->getDedicated()->getLogger() );
    if ( m_pMapVHost->getSSLContext()
        ||( m_pSubIpMap && m_pSubIpMap->hasSSL() ) )
        m_isSSL = 1;
}
Exemplo n.º 3
0
ColumnOpCompress1::ColumnOpCompress1(Log* logger)
{
	m_compressionType = 1;
   m_chunkManager = new ChunkManager();
   if (logger)
   {
		setDebugLevel( logger->getDebugLevel() );
		setLogger    ( logger );
   }
   m_chunkManager->fileOp(this);
}
Exemplo n.º 4
0
	bool SoundEngineOpenAL::init(std::string device)
	{
		// Create logger
		FileLogger *logger = new FileLogger;
		if (logger->init("RaumKlang.htm"))
		{
			setLogger(logger);
		}
		else
		{
			delete logger;
			setLogger(new ConsoleLogger());
		}
		// Get default device
		if (device == "")
		{
			device = alcGetString(0, ALC_DEFAULT_DEVICE_SPECIFIER);
		}
		// Setup OpenAL context
		ALCdevice *dev = alcOpenDevice(device.c_str());
		if (!dev)
			return false;
		ALCcontext *context = alcCreateContext(dev, 0);
		alcMakeContextCurrent(context);
		if (alcGetError(dev) != ALC_NO_ERROR)
			return false;
		// Startup message
		getLogger()->writeLine(ELL_Information, "RaumKlang 0.0.1 (OpenAL)");
		getLogger()->writeLine(ELL_Information,
			std::string("Device: ") + device);
		// Create listener
		listener = new ListenerOpenAL();
		// Add stream loaders
		initStreamLoaders();
		// Start update thread
		running = true;
		threadstopped = false;
		startUpdateThread();
		return true;
	}
Exemplo n.º 5
0
EMULATOR_SESSION_CLASS::~EMULATOR_SESSION_CLASS()

//  DESCRIPTION     : Destructor.
//  PRECONDITIONS   :
//  POSTCONDITIONS  :
//  EXCEPTIONS      :
//  NOTES           :
//<<===========================================================================
{
	// destructor activities
	while (supportedTransferSyntaxM.getSize())
	{
		supportedTransferSyntaxM.removeAt(0);
	}
	cleanup();
	setLogger(NULL);
}
Exemplo n.º 6
0
void EARA::initialize(int stage) {
    AbstractOMNeTARAClient::initialize(stage);
    if(stage == 4) {
        OMNeTEARAConfiguration config = OMNeTEARAConfiguration(this);
        setLogger(config.getLogger());

        AbstractEARAClient::initializeEARA(config);
        initializeNetworkInterfacesOf(this, config);

        notificationBoard->subscribe(this, NF_BATTERY_CHANGED);
        WATCH(nrOfDetectedLoops);
        WATCH(maximumBatteryCapacityInNetwork);
        LOOP_DETECTION_SIGNAL = registerSignal("routingLoopDetected");
        DROP_PACKET_WITH_ZERO_TTL = registerSignal("dropZeroTTLPacket");
        ROUTE_FAILURE_NO_HOP = registerSignal("routeFailureNoHopAvailable");
        NEW_ROUTE_DISCOVERY = registerSignal("newRouteDiscovery");
        ROUTE_FAILURE_NEXT_HOP_IS_SENDER =  registerSignal("routeFailureNextHopIsSender");
        new EARARoutingTableWatcher(routingTable);
    }
}
Exemplo n.º 7
0
HTTPCookieAuth::HTTPCookieAuth(PionUserManagerPtr userManager,
							   const std::string& login,
							   const std::string& logout,
							   const std::string& redirect)
	: HTTPAuth(userManager), m_login(login), m_logout(logout), m_redirect(redirect),
	m_random_gen(), m_random_range(0, 255), m_random_die(m_random_gen, m_random_range),
	m_cache_cleanup_time(boost::posix_time::second_clock::universal_time())
{
    // set logger for this class
	setLogger(PION_GET_LOGGER("pion.net.HTTPCookieAuth"));

	// Seed random number generator with current time as time_t int value, cast to the required type.
	// (Note that boost::mt19937::result_type is boost::uint32_t, and casting to an unsigned n-bit integer is
	// defined by the standard to keep the lower n bits.  Since ::time() returns seconds since Jan 1, 1970, 
	// it will be a long time before we lose any entropy here, even if time_t is a 64-bit int.)
	m_random_gen.seed(static_cast<boost::mt19937::result_type>(::time(NULL)));

	// generate some random numbers to increase entropy of the rng
	for (unsigned int n = 0; n < 100; ++n)
		m_random_die();
}
Exemplo n.º 8
0
	/// constructs a new FilterReactor object
	FilterReactor(void) : Reactor(TYPE_PROCESSING) { setLogger(PION_GET_LOGGER("pion.FilterReactor")); }
Exemplo n.º 9
0
ProtocolFactory::ProtocolFactory(const VocabularyManager& vocab_mgr)
	: PluginConfig<Protocol>(vocab_mgr, DEFAULT_CONFIG_FILE, PROTOCOL_ELEMENT_NAME)
{
	setLogger(PION_GET_LOGGER("pion.platform.ProtocolFactory"));
}
Exemplo n.º 10
0
Arquivo: ion.c Projeto: b/ION
static void	ionRedirectMemos()
{
	setLogger(writeMemoToIonLog);
}
Exemplo n.º 11
0
EMULATOR_SESSION_CLASS::EMULATOR_SESSION_CLASS()

//  DESCRIPTION     : Constructor.
//  PRECONDITIONS   :
//  POSTCONDITIONS  :
//  EXCEPTIONS      :
//  NOTES           :
//<<===========================================================================
{
	// constructor activities
	// - needs cleaning up properly
    ACTIVITY_LOG_CLASS *activityLogger_ptr = new ACTIVITY_LOG_CLASS();
	logMaskM = LOG_ERROR | LOG_WARNING | LOG_INFO;
    serverSocketM_ptr = NULL;
	setLogger(activityLogger_ptr);
	setActivityReporter(NULL);
	setSerializer(NULL);

	runtimeSessionTypeM = ST_EMULATOR;
	sessionTypeM = ST_EMULATOR;
	sessionFileVersionM = 0;
	sessionTitleM = "";
	isOpenM = false;
	filenameM = "";
	setSessionId(1);
	manufacturerM = MANUFACTURER;
	modelNameM = MODEL_NAME;
	softwareVersionsM = IMPLEMENTATION_VERSION_NAME;
	applicationEntityNameM = APPLICATION_ENTITY_NAME;
	applicationEntityVersionM = APPLICATION_ENTITY_VERSION;
	testedByM = TESTED_BY;
	dateM = DATE;

    sutRoleM = UP_ACCEPTOR;
	dvtAeTitleM = CALLING_AE_TITLE;
    sutAeTitleM = CALLED_AE_TITLE;
	dvtMaximumLengthReceivedM = MAXIMUM_LENGTH_RECEIVED;
	dvtImplementationClassUidM = IMPLEMENTATION_CLASS_UID;
	dvtImplementationVersionNameM = IMPLEMENTATION_VERSION_NAME;

    sutMaximumLengthReceivedM = 0;
	sutImplementationClassUidM = "";
	sutImplementationVersionNameM = "";

	logScpThreadM = true;
	strictValidationM = false;
	detailedValidationResultsM = true;
	summaryValidationResultsM = true;
	includeType3NotPresentInResultsM = false;
	autoType2AttributesM = false;
	defineSqLengthM = false;
	addGroupLengthM = false;

    setDefinitionFileRoot(".\\");
	dataDirectoryM = ".\\";
	resultsRootM = ".\\";
	appendToResultsFileM = false;
	storageModeM = SM_NO_STORAGE;
	counterM = 0;
	instanceIdM = 1;
	isSessionStoppedM = false;
	scpEmulatorTypeM = SCP_EMULATOR_UNKNOWN;
	scuEmulatorTypeM = SCU_EMULATOR_UNKNOWN;
}
Exemplo n.º 12
0
void BASE_SCP_EMULATOR_CLASS::setup(EMULATOR_SESSION_CLASS *session_ptr, BASE_SOCKET_CLASS* socket_ptr, bool logEmulation)

//  DESCRIPTION     : Set up all the logging and serialization.
//  PRECONDITIONS   :
//  POSTCONDITIONS  :
//  EXCEPTIONS      : 
//  NOTES           :
//<<===========================================================================
{
	//
	// Interfaces towards managed code.
	//
	ACTIVITY_LOG_CLASS *activityLogger_ptr = NULL;
	BASE_SERIALIZER *serializer_ptr = NULL;

	//
	// Constructor activities.
	//
	sessionM_ptr = session_ptr;
	autoType2AttributesM = false;
	defineSqLengthM = false;
	addGroupLengthM = false;
	associationM.setSocket(socket_ptr);
	//
	// Determine which logger is assigned to the session.
	//
	LOG_CLASS *sessionLogger_ptr = session_ptr->getLogger();
	if (logEmulation &&
		(sessionLogger_ptr != NULL))
	{
		//
		// Setup a child activity logger.
		//
		activityLogger_ptr = new ACTIVITY_LOG_CLASS();
		activityLogger_ptr->setActivityReporter(sessionLogger_ptr->getActivityReporter());
		//
		// Setup session serializer. 
		// Spawn a child serializer based on the current parent serializer.
		// This serializer is the target for the validation output.
		//
		BASE_SERIALIZER *sessionSerializer = sessionLogger_ptr->getSerializer();
		if (sessionSerializer)
		{
			serializer_ptr = sessionSerializer->CreateAndRegisterChildSerializer(::SerializerNodeType_Thread);
			serializer_ptr->StartSerializer();
			activityLogger_ptr->setSerializer(serializer_ptr);
		}
		//
		// Apply log mask settings.
		//
		UINT32 logMask = sessionLogger_ptr->getLogMask();
		logMask |= (LOG_NONE | LOG_SCRIPT | LOG_MEDIA_FILENAME);
		activityLogger_ptr->setLogMask(logMask);
		activityLogger_ptr->setResultsRoot(sessionLogger_ptr->getResultsRoot());
		activityLogger_ptr->setStorageRoot(sessionLogger_ptr->getStorageRoot());
	}
	//
	// Apply logger.
	//
	setLogger(activityLogger_ptr);
	//
	// Apply serializer.
	//
    setSerializer(serializer_ptr);
}
Exemplo n.º 13
0
ServerThread::ServerThread(Logger *logger, int listenPort, const std::string &nodeName)
	: Thread("serv"), m_listenPort(listenPort), m_nodeName(nodeName) {
	setLogger(logger);
}
Exemplo n.º 14
0
QXmppClient::QXmppClient(QObject *parent)
    : QXmppLoggable(parent),
    d(new QXmppClientPrivate(this))
{
    bool check;
    Q_UNUSED(check);

    d->stream = new QXmppOutgoingClient(this);
    d->addProperCapability(d->clientPresence);

    check = connect(d->stream, SIGNAL(elementReceived(QDomElement,bool&)),
                    this, SLOT(_q_elementReceived(QDomElement,bool&)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(messageReceived(QXmppMessage)),
                    this, SIGNAL(messageReceived(QXmppMessage)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(presenceReceived(QXmppPresence)),
                    this, SIGNAL(presenceReceived(QXmppPresence)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(iqReceived(QXmppIq)),
                    this, SIGNAL(iqReceived(QXmppIq)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(sslErrors(QList<QSslError>)),
                    this, SIGNAL(sslErrors(QList<QSslError>)));
    Q_ASSERT(check);

    check = connect(d->stream->socket(), SIGNAL(stateChanged(QAbstractSocket::SocketState)),
                    this, SLOT(_q_socketStateChanged(QAbstractSocket::SocketState)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(connected()),
                    this, SLOT(_q_streamConnected()));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(disconnected()),
                    this, SLOT(_q_streamDisconnected()));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(error(QXmppClient::Error)),
                    this, SLOT(_q_streamError(QXmppClient::Error)));
    Q_ASSERT(check);

    // reconnection
    d->reconnectionTimer = new QTimer(this);
    d->reconnectionTimer->setSingleShot(true);
    connect(d->reconnectionTimer, SIGNAL(timeout()),
            this, SLOT(_q_reconnect()));
    Q_ASSERT(check);

    // logging
    setLogger(QXmppLogger::getLogger());

    addExtension(new QXmppRosterManager(this));
    addExtension(new QXmppVCardManager);
    addExtension(new QXmppVersionManager);
    addExtension(new QXmppEntityTimeManager());
    addExtension(new QXmppDiscoveryManager());
}
Exemplo n.º 15
0
void CRLog::setFileLogger(const char * fname, bool autoFlush)
{
	setLogger(new CRFileLogger(fname, autoFlush));
}
Exemplo n.º 16
0
void CRLog::setStderrLogger()
{
	setLogger(new CRFileLogger((FILE*)stderr, false, true));
}
Exemplo n.º 17
0
ColumnOpCompress0::ColumnOpCompress0(Log* logger)
{
   m_compressionType = 0;
   setDebugLevel( logger->getDebugLevel() );
   setLogger    ( logger );
}
Exemplo n.º 18
0
QXmppClient::QXmppClient(QObject *parent)
    : QXmppLoggable(parent),
    d(new QXmppClientPrivate(this))
{
    d->stream = new QXmppOutgoingClient(this);
    d->addProperCapability(d->clientPresence);

    bool check = connect(d->stream, SIGNAL(elementReceived(const QDomElement&, bool&)),
                         this, SLOT(slotElementReceived(const QDomElement&, bool&)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(messageReceived(const QXmppMessage&)),
                         this, SIGNAL(messageReceived(const QXmppMessage&)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(presenceReceived(const QXmppPresence&)),
                    this, SIGNAL(presenceReceived(const QXmppPresence&)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(iqReceived(const QXmppIq&)), this,
        SIGNAL(iqReceived(const QXmppIq&)));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(disconnected()), this,
        SIGNAL(disconnected()));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(connected()), this,
        SLOT(xmppConnected()));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(connected()), this,
        SIGNAL(connected()));
    Q_ASSERT(check);

    check = connect(d->stream, SIGNAL(error(QXmppClient::Error)), this,
        SIGNAL(error(QXmppClient::Error)));
    Q_ASSERT(check);

    check = setReconnectionManager(new QXmppReconnectionManager(this));
    Q_ASSERT(check);

    // logging
    d->logger = 0;
    setLogger(QXmppLogger::getLogger());

    // create managers
    // TODO move manager references to d->extensions
    d->rosterManager = new QXmppRosterManager(this);
    addExtension(d->rosterManager);

    d->vCardManager = new QXmppVCardManager;
    addExtension(d->vCardManager);

    d->versionManager = new QXmppVersionManager;
    addExtension(d->versionManager);

    addExtension(new QXmppEntityTimeManager());

    QXmppDiscoveryManager *discoveryManager = new QXmppDiscoveryManager;
    addExtension(discoveryManager);

    // obsolete signal
    check = connect(discoveryManager, SIGNAL(infoReceived(QXmppDiscoveryIq)),
                    this, SIGNAL(discoveryIqReceived(QXmppDiscoveryIq)));
    Q_ASSERT(check);

    check = connect(discoveryManager, SIGNAL(itemsReceived(QXmppDiscoveryIq)),
                    this, SIGNAL(discoveryIqReceived(QXmppDiscoveryIq)));
    Q_ASSERT(check);
}
Exemplo n.º 19
0
CodecFactory::CodecFactory(const VocabularyManager& vocab_mgr)
	: PluginConfig<Codec>(vocab_mgr, DEFAULT_CONFIG_FILE, CODEC_ELEMENT_NAME)
{
	setLogger(PION_GET_LOGGER("pion.platform.CodecFactory"));
}
Exemplo n.º 20
0
HTTPBasicAuth::HTTPBasicAuth(PionUserManagerPtr userManager, const std::string& realm)
	: HTTPAuth(userManager), m_realm(realm),
	m_cache_cleanup_time(boost::posix_time::second_clock::universal_time())
{
	setLogger(PION_GET_LOGGER("pion.net.HTTPBasicAuth"));
}
	Tracker(int width, int height, bool debug) :
		ARToolKitPlus::TrackerSingleMarkerImpl<6,6,1024, 1, 32>(width, height) {
		// Set logger
		if (debug)
			setLogger(new Logger());
	}