#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130502.4]"
+#define OSP_INSTALLER_VERSION "version=[20130502.5]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
#define TERMINATE_RETRY_COUNT 300
#define DIR_OSP_APPLICATIONS_TEMP L"/opt/usr/apps/__@@osp_tmp@@__"
+#define DIR_INSTALL_LOGS L"/opt/usr/apps/logs"
#define DIR_RO_PACKAGE_SYSTEM_MANIFEST L"/usr/share/packages/%ls.xml"
#define DIR_RW_PACKAGE_SYSTEM_MANIFEST L"/opt/share/packages/%ls.xml"
,__startTick(0)
,__endTick(0)
,__isFileLogOn(false)
+,__isHistoryFileLogOn(false)
{
}
__isFileLogOn = true;
}
+
+ if (File::IsFileExist(DIR_INSTALL_LOGS) == false)
+ {
+ r = Directory::Create(DIR_INSTALL_LOGS, false);
+ if (IsFailed(r))
+ {
+ // logs
+ }
+ }
+
+ String logPath = path;
+ String logId;
+ int length = logPath.GetLength();
+ if (logPath.EndsWith("/") == true)
+ {
+ logPath.Remove(length - 1, 1);
+ length--;
+ }
+ logPath.SubString(length - PACKAGE_ID_LENGTH, PACKAGE_ID_LENGTH, logId);
+ AppLog("logPath = [%ls], logId = [%ls]", __historyLogFilePath.GetPointer(), logId.GetPointer());
+
+ __historyLogFilePath = DIR_INSTALL_LOGS;
+ __historyLogFilePath += L"/";
+ __historyLogFilePath += logId;
+ __historyLogFilePath += L".txt";
+ InstallerUtil::CreateLog(__historyLogFilePath);
+
+ AppLog("__historyLogFilePath = [%ls]", __historyLogFilePath.GetPointer());
+
+ __isHistoryFileLogOn = true;
}
AppLog("------------------------------------------");
return __logFilePath;
}
+String
+InstallerManager::GetHistoryLogFilePath() const
+{
+ return __historyLogFilePath;
+}
+
bool
InstallerManager::IsFileLogOn() const
{
}
bool
+InstallerManager::IsHistoryFileLogOn() const
+{
+ return __isHistoryFileLogOn;
+}
+
+bool
InstallerManager::SendEvent(InstallationContext* pContext, const PackageId& packageId, const String& key, const String& val)
{
TryReturn(pContext, false, "pContext is null.");
InstallerOperation GetInstallerOperation(void) const;
Tizen::Base::String GetLogFilePath() const;
+ Tizen::Base::String GetHistoryLogFilePath() const;
bool IsFileLogOn() const;
+ bool IsHistoryFileLogOn() const;
static bool SendEvent(InstallationContext* pContext, const Tizen::App::PackageId& packageId, const Tizen::Base::String& key, const Tizen::Base::String& val);
long long __startTick;
long long __endTick;
Tizen::Base::String __logFilePath;
+ Tizen::Base::String __historyLogFilePath;
bool __isFileLogOn;
+ bool __isHistoryFileLogOn;
}; // InstallerManager
va_end(args);
return false;
}
+
+ if (pManager->IsHistoryFileLogOn() == true)
+ {
+ File historyLogFile;
+ String historyLogFilePath = pManager->GetHistoryLogFilePath();
+ r = historyLogFile.Construct(historyLogFilePath, "a");
+ if (!IsFailed(r))
+ {
+ r = historyLogFile.Write(logs2, length+1);
+ if (!IsFailed(r))
+ {
+ // success
+ }
+ }
+ }
+
va_end(args);
return true;