return result_;
}
-void AppInstaller::LogHistory(bool success) {
+void AppInstaller::LogHistoryStart() {
+ std::shared_ptr<utils::FileLogBackend> history_logger =
+ std::shared_ptr<utils::FileLogBackend>(new utils::FileLogBackend(
+ kHistoryFileName, kLogRotationSize, kLogMaximumRotation));
+ std::string history = "pkgid:" + context_->pkgid.get() + "|mode:" +
+ GetRequestTypeString(context_->request_type.get());
+ history += "|START";
+ history_logger->WriteLog(::utils::LogLevel::LOG_INFO, "", history);
+ history_logger->WriteLogToFile();
+}
+
+void AppInstaller::LogHistoryEnd(bool success) {
std::shared_ptr<utils::FileLogBackend> history_logger =
std::shared_ptr<utils::FileLogBackend>(new utils::FileLogBackend(
kHistoryFileName, kLogRotationSize, kLogMaximumRotation));
status_ = Step::Status::ERROR;
SendFinished(status_);
- LogHistory(false);
+ LogHistoryEnd(false);
return result_;
}
} while (it_-- != steps_.begin());
sync();
- LogHistory(true);
+ LogHistoryEnd(true);
return result_;
}
pi_->SetRequestType(context_->request_type.get());
pi_->SendStarted(context_->pkg_type.get(), context_->pkgid.get());
+ LogHistoryStart();
+
return true;
}
std::shared_ptr<utils::FileLogBackend> failure_logger_;
Step::Status status_;
Result result_;
- void LogHistory(bool success);
+ void LogHistoryStart();
+ void LogHistoryEnd(bool success);
int index_;