| 403 | } |
| 404 | |
| 405 | void CompatLogger::EventCommandHandler(const Checkable::Ptr& checkable) |
| 406 | { |
| 407 | Host::Ptr host; |
| 408 | Service::Ptr service; |
| 409 | tie(host, service) = GetHostService(checkable); |
| 410 | |
| 411 | EventCommand::Ptr event_command = checkable->GetEventCommand(); |
| 412 | String event_command_name = event_command->GetName(); |
| 413 | long current_attempt = checkable->GetCheckAttempt(); |
| 414 | |
| 415 | std::ostringstream msgbuf; |
| 416 | |
| 417 | if (service) { |
| 418 | msgbuf << "SERVICE EVENT HANDLER: " |
| 419 | << host->GetName() << ";" |
| 420 | << service->GetShortName() << ";" |
| 421 | << Service::StateToString(service->GetState()) << ";" |
| 422 | << Checkable::StateTypeToString(service->GetStateType()) << ";" |
| 423 | << current_attempt << ";" |
| 424 | << event_command_name; |
| 425 | } else { |
| 426 | msgbuf << "HOST EVENT HANDLER: " |
| 427 | << host->GetName() << ";" |
| 428 | << GetHostStateString(host) << ";" |
| 429 | << Checkable::StateTypeToString(host->GetStateType()) << ";" |
| 430 | << current_attempt << ";" |
| 431 | << event_command_name; |
| 432 | } |
| 433 | |
| 434 | { |
| 435 | ObjectLock oLock(this); |
| 436 | WriteLine(msgbuf.str()); |
| 437 | Flush(); |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | String CompatLogger::GetHostStateString(const Host::Ptr& host) |
| 442 | { |
nothing calls this directly
no test coverage detected