Update the size check in MessagePort
[platform/framework/native/appfw.git] / inc / FBaseSysLog.h
index 762783a..75f3c35 100644 (file)
@@ -75,7 +75,7 @@ extern "C" {
  * The following example demonstrates how to use the SysLog macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        SysLog(NID, "Initialization successful.");
@@ -100,7 +100,7 @@ extern "C" {
  * The following example demonstrates how to use the SysLogException macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -132,7 +132,7 @@ extern "C" {
  * The following example demonstrates how to use the SysLogTag macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        SysLogTag(NID, "MyTag", "Initialization successful.");
@@ -158,7 +158,7 @@ extern "C" {
  * The following example demonstrates how to use the SysLogTagException macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        SysLogExceptionTag(NID, "MyTag", E_INVALID_ARG, "Initialization successful.");
@@ -185,7 +185,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryLog macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -220,7 +220,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryLogCatch macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -258,7 +258,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryLogReturn macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -296,7 +296,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryReturn macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -334,7 +334,7 @@ extern "C" {
  *
  * @code
  * #define E_UNKNOWN_ERROR 1
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -370,7 +370,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryReturnVoidResult macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -408,7 +408,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryCatch macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -449,7 +449,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryCatchLabel macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -485,7 +485,7 @@ extern "C" {
  * The following example demonstrates how to use the SysAssert macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -517,7 +517,7 @@ extern "C" {
  * The following example demonstrates how to use the SysAssertf macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -549,7 +549,7 @@ extern "C" {
  * The following example demonstrates how to use the SysStaticAssert macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -580,7 +580,7 @@ case condition: \
  * The following example demonstrates how to use the SysPropagate macro.
  *
  * @code
- *     Bool
+ *     bool
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -594,6 +594,133 @@ case condition: \
  */
 #define SysPropagate(NID, r)        SysPropagateInternal(__PRETTY_FUNCTION__, __LINE__, NID, r)
 
+// Secure Macros
+#if defined(_SECURE_LOG)
+
+#define SysSecureLog(NID, ...)                         SysLogInternal(NID, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+#define SysSecureLogException(NID, r,...)              SysLogExceptionInternal(NID, r, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+
+#define SysSecureLogTag(NID, tag, ...)                 SysLogTagInternal(NID, tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+#define SysSecureLogExceptionTag(NID, tag, r, ...)     SysLogExceptionTagInternal(NID, tag, r, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+
+#else
+
+/**
+* This macro is to protect informative log messages which needs to keep security.
+* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+* Otherwise, it will be removed in the compile time.
+* This system log macro is for the platform modules.
+*
+* @since 2.1
+*
+* @param[in]   NID                     The Tizen namespace ID
+* @param[in]   ...                     The message to display
+*
+* The following example demonstrates how to use the SysSecureLog macro.
+*
+* @code
+*        bool
+*        MyEngine::Init(int value)
+*        {
+*           SysSecureLog(NID, "User ID : 'JoneDoe'");
+*
+*           return true;
+*        }
+* @endcode
+* @hideinitializer
+*/
+#define SysSecureLog(NID, ...)
+
+/**
+* This macro is to protect exception log messages which needs to keep security, and sets the last result.
+* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+* Otherwise, it will be removed in the compile time.
+* This system log macro is for the platform modules.
+*
+* @since 2.1
+*
+* @param[in]   NID                     The Tizen namespace ID
+* @param[in]   r                       The last result to set
+* @param[in]   ...                     The message to display
+*
+* The following example demonstrates how to use the SysSecureLogException macro.
+*
+* @code
+*        bool
+*        MyEngine::Init(int value)
+*        {
+*           //...
+*           if (something_wrong)
+*           {
+*              SysSecureLogException(NID,  E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
+*
+*              return false;
+*           }
+*   //...
+*
+*           return true;
+*        }
+* @endcode
+* @hideinitializer
+*/
+#define SysSecureLogException(NID, r,...)
+
+/**
+* This macro is to protect informative log messages which needs to keep security, with a tag.
+* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+* Otherwise, it will be removed in the compile time.
+* This system log macro is for the platform modules.
+*
+* @since 2.1
+*
+* @param[in]   NID                     The Tizen namespace ID
+* @param[in]   tag                     The user defined tag
+* @param[in]   ...                     The message to display
+*
+* The following example demonstrates how to use the SysSecureLogTag macro.
+*
+* @code
+*        bool
+*        MyEngine::Init(int value)
+*        {
+*           SysSecureLogTag(NID, "MyTag", "User ID : 'JoneDoe'");
+*
+*           return true;
+*        }
+* @endcode
+* @hideinitializer
+*/
+#define SysSecureLogTag(NID, tag, ...)
+
+/**
+* This macro is to protect exception log messages which needs to keep security, with a tag and sets the last result.
+* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+* Otherwise, it will be removed in the compile time.
+* This system log macro is for the platform modules.
+*
+* @since 2.1
+*
+* @param[in]   NID                     The Tizen namespace ID
+* @param[in]   tag                     The user defined tag
+* @param[in]   r                       The last result to set
+* @param[in]   ...                     The message to display
+*
+* The following example demonstrates how to use the SysSecureLogExceptionTag macro.
+*
+* @code
+*        bool
+*        MyEngine::Init(int value)
+*        {
+*           SysSecureLogExceptionTag(NID, "MyTag", E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
+*
+*           return true;
+*        }
+* @endcode
+* @hideinitializer
+*/
+#define SysSecureLogExceptionTag(NID, tag, r, ...)
+
+#endif
 
 /**
  * Defines the log ID.
@@ -657,7 +784,9 @@ enum LogID
 
        NID_WEB = 180,
        NID_WEB_CTRL = 181,
-       NID_WEB_JSON = 182
+       NID_WEB_JSON = 182,
+
+       NID_SHELL = 190
 };
 
 /**