Add preload webapp
authorSoyoung Kim <sy037.kim@samsung.com>
Fri, 19 Apr 2013 15:19:32 +0000 (00:19 +0900)
committerGerrit Code Review <gerrit2@kim11>
Fri, 19 Apr 2013 15:29:14 +0000 (00:29 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] modify path of preload webapp.
Add to print standard error for prelaod.
[SCMRequest] This package should release with wrt-installer.

modules/log/include/dpl/log/old_style_log_provider.h
modules/log/src/old_style_log_provider.cpp
modules/widget_dao/include/dpl/wrt-dao-ro/global_config.h

index becdc93..70e308a 100644 (file)
@@ -36,6 +36,7 @@ class OldStyleLogProvider :
     bool m_showWarning;
     bool m_showError;
     bool m_showPedantic;
+    bool m_printStdErr;
 
     static std::string FormatMessage(const char *message,
                                      const char *filename,
@@ -48,6 +49,12 @@ class OldStyleLogProvider :
                         bool showWarning,
                         bool showError,
                         bool showPedantic);
+    OldStyleLogProvider(bool showDebug,
+                        bool showInfo,
+                        bool showWarning,
+                        bool showError,
+                        bool showPedantic,
+                        bool printStdErr);
     virtual ~OldStyleLogProvider() {}
 
     virtual void Debug(const char *message,
index 84433af..b8060dd 100644 (file)
@@ -89,7 +89,22 @@ OldStyleLogProvider::OldStyleLogProvider(bool showDebug,
     m_showInfo(showInfo),
     m_showWarning(showWarning),
     m_showError(showError),
-    m_showPedantic(showPedantic)
+    m_showPedantic(showPedantic),
+    m_printStdErr(false)
+{}
+
+OldStyleLogProvider::OldStyleLogProvider(bool showDebug,
+                                         bool showInfo,
+                                         bool showWarning,
+                                         bool showError,
+                                         bool showPedantic,
+                                         bool printStdErr) :
+    m_showDebug(showDebug),
+    m_showInfo(showInfo),
+    m_showWarning(showWarning),
+    m_showError(showError),
+    m_showPedantic(showPedantic),
+    m_printStdErr(printStdErr)
 {}
 
 void OldStyleLogProvider::Debug(const char *message,
@@ -98,9 +113,15 @@ void OldStyleLogProvider::Debug(const char *message,
                                 const char *function)
 {
     if (m_showDebug) {
-        fprintf(stdout, "%s%s%s\n", DEBUG_BEGIN,
-                FormatMessage(message, filename, line,
-                              function).c_str(), DEBUG_END);
+        if (m_printStdErr) {
+            fprintf(stderr, "%s%s%s\n", DEBUG_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), DEBUG_END);
+        } else {
+            fprintf(stdout, "%s%s%s\n", DEBUG_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), DEBUG_END);
+        }
     }
 }
 
@@ -110,9 +131,15 @@ void OldStyleLogProvider::Info(const char *message,
                                const char *function)
 {
     if (m_showInfo) {
-        fprintf(stdout, "%s%s%s\n", INFO_BEGIN,
-                FormatMessage(message, filename, line,
-                              function).c_str(), INFO_END);
+        if (m_printStdErr) {
+            fprintf(stderr, "%s%s%s\n", INFO_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), INFO_END);
+        } else {
+            fprintf(stdout, "%s%s%s\n", INFO_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), INFO_END);
+        }
     }
 }
 
@@ -122,9 +149,15 @@ void OldStyleLogProvider::Warning(const char *message,
                                   const char *function)
 {
     if (m_showWarning) {
-        fprintf(stdout, "%s%s%s\n", WARNING_BEGIN,
-                FormatMessage(message, filename, line,
-                              function).c_str(), WARNING_END);
+        if (m_printStdErr) {
+            fprintf(stderr, "%s%s%s\n", WARNING_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), WARNING_END);
+        } else {
+            fprintf(stdout, "%s%s%s\n", WARNING_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), WARNING_END);
+        }
     }
 }
 
@@ -134,9 +167,15 @@ void OldStyleLogProvider::Error(const char *message,
                                 const char *function)
 {
     if (m_showError) {
-        fprintf(stdout, "%s%s%s\n", ERROR_BEGIN,
-                FormatMessage(message, filename, line,
-                              function).c_str(), ERROR_END);
+        if (m_printStdErr) {
+            fprintf(stderr, "%s%s%s\n", ERROR_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), ERROR_END);
+        } else {
+            fprintf(stdout, "%s%s%s\n", ERROR_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), ERROR_END);
+        }
     }
 }
 
@@ -146,9 +185,15 @@ void OldStyleLogProvider::Pedantic(const char *message,
                                    const char *function)
 {
     if (m_showPedantic) {
-        fprintf(stdout, "%s%s%s\n", PEDANTIC_BEGIN,
-                FormatMessage(message, filename, line,
-                              function).c_str(), PEDANTIC_END);
+        if (m_printStdErr) {
+            fprintf(stderr, "%s%s%s\n", PEDANTIC_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), PEDANTIC_END);
+        } else {
+            fprintf(stdout, "%s%s%s\n", PEDANTIC_BEGIN,
+                    FormatMessage(message, filename, line,
+                        function).c_str(), PEDANTIC_END);
+        }
     }
 }
 }
index 13cec1d..a2fa66a 100644 (file)
@@ -65,10 +65,7 @@ inline const char* GetUserInstalledWidgetPath()
  */
 inline const char* GetUserPreloadedWidgetPath()
 {
-    // temp
-    // return "/usr/apps";
-
-    return "/opt/usr/apps";
+    return "/usr/apps";
 }
 
 /**