mirror of https://github.com/Icinga/icinga2.git
commit
84fbbd5beb
|
@ -88,12 +88,12 @@ void icinga::Log(LogSeverity severity, const String& facility,
|
||||||
bool processed = false;
|
bool processed = false;
|
||||||
|
|
||||||
BOOST_FOREACH(const Logger::Ptr& logger, Logger::GetLoggers()) {
|
BOOST_FOREACH(const Logger::Ptr& logger, Logger::GetLoggers()) {
|
||||||
if (!logger->IsActive())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock llock(logger);
|
ObjectLock llock(logger);
|
||||||
|
|
||||||
|
if (!logger->IsActive())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (entry.Severity >= logger->GetMinSeverity())
|
if (entry.Severity >= logger->GetMinSeverity())
|
||||||
logger->ProcessLogEntry(entry);
|
logger->ProcessLogEntry(entry);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,16 +32,19 @@ REGISTER_TYPE(TimePeriod);
|
||||||
|
|
||||||
static Timer::Ptr l_UpdateTimer;
|
static Timer::Ptr l_UpdateTimer;
|
||||||
|
|
||||||
void TimePeriod::Start(void)
|
INITIALIZE_ONCE(&TimePeriod::StaticInitialize);
|
||||||
{
|
|
||||||
DynamicObject::Start();
|
|
||||||
|
|
||||||
if (!l_UpdateTimer) {
|
void TimePeriod::StaticInitialize(void)
|
||||||
|
{
|
||||||
l_UpdateTimer = make_shared<Timer>();
|
l_UpdateTimer = make_shared<Timer>();
|
||||||
l_UpdateTimer->SetInterval(300);
|
l_UpdateTimer->SetInterval(300);
|
||||||
l_UpdateTimer->OnTimerExpired.connect(boost::bind(&TimePeriod::UpdateTimerHandler));
|
l_UpdateTimer->OnTimerExpired.connect(boost::bind(&TimePeriod::UpdateTimerHandler));
|
||||||
l_UpdateTimer->Start();
|
l_UpdateTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TimePeriod::Start(void)
|
||||||
|
{
|
||||||
|
DynamicObject::Start();
|
||||||
|
|
||||||
/* Pre-fill the time period for the next 24 hours. */
|
/* Pre-fill the time period for the next 24 hours. */
|
||||||
double now = Utility::GetTime();
|
double now = Utility::GetTime();
|
||||||
|
|
|
@ -38,6 +38,8 @@ public:
|
||||||
DECLARE_PTR_TYPEDEFS(TimePeriod);
|
DECLARE_PTR_TYPEDEFS(TimePeriod);
|
||||||
DECLARE_TYPENAME(TimePeriod);
|
DECLARE_TYPENAME(TimePeriod);
|
||||||
|
|
||||||
|
static void StaticInitialize(void);
|
||||||
|
|
||||||
virtual void Start(void);
|
virtual void Start(void);
|
||||||
|
|
||||||
void UpdateRegion(double begin, double end, bool clearExisting);
|
void UpdateRegion(double begin, double end, bool clearExisting);
|
||||||
|
|
Loading…
Reference in New Issue