Commit 921fbc07 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

still adding security mechanisms to CustomLogging

parent 013f0b24
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ public:
     * Get a string representation of the extra data of this log record.
     * @return the string representation as "[key1=value1, key2=value2 .... ]"
     */
    std::string get_extra_data_string();
    std::string get_extra_data_string() const;
};

/**
+9 −3
Original line number Diff line number Diff line
@@ -294,8 +294,8 @@ CustomLoggerImpl::emitExceptionLog()
void
CustomLoggerImpl::flush() throw (CORBA::SystemException)
{
    maci::ContainerImpl::getLoggerProxy()->flush();
    writeLoggingQueue();
    maci::ContainerImpl::getLoggerProxy()->flush();
};

void 
@@ -409,8 +409,14 @@ CustomLoggerImpl::filter(LogRecord& log_record)
    bool filtered=false;
    if((log_record._finished) && //check if we are logging
       // check if the log level is accepted by our logger
       (m_min_level_sp->getDevIO()->read(ts) <= log_record.log_level) && 
       (m_max_level_sp->getDevIO()->read(ts) >= log_record.log_level))
       (IRA::CustomLoggerUtils::custom2aceLogLevel(
            m_min_level_sp->getDevIO()->read(ts)) <=
       (IRA::CustomLoggerUtils::custom2aceLogLevel(
            log_record.log_level))) && 
       (IRA::CustomLoggerUtils::custom2aceLogLevel(
            m_max_level_sp->getDevIO()->read(ts)) >= 
       (IRA::CustomLoggerUtils::custom2aceLogLevel(
            log_record.log_level))))
    {
        if(log_record.process_name == CUSTOM_PYTHON_LOGGING_PROCESS){ //if the log record has been produced by IRAPy logger
            filtered = true; 
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,11 @@ unittest_OBJECTS = unittest
unittest_LIBS = $(GTEST_LIBS) CustomLoggerImpl
unittest_LDFLAGS = -lstdc++ -lpthread

EXECUTABLES_L = log_exceptions
log_exceptions_OBJECTS = log_exceptions
log_exceptions_LIBS = maci maciClient IRALibrary ManagementErrors
log_exceptions_LDFLAGS = -lstdc++ -lpthread

# END OF CUSTOMIZATION
# do not edit below this line
#----------------------------