2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
20 * @brief This is the header file for the diagnostic types.
22 * This header file defines the diagnostic types.
29 #include <FOspConfig.h>
36 * @defgroup GroupMacros Debugging Macros
38 * This page describes Tizen debugging macros.
43 #if defined(_APP_LOG) || defined(_OSP_DEBUG_) || defined(_DEBUG)
47 #define AppLog(...) AppLogInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
48 #define AppLogDebug(...) AppLogDebugInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
49 #define AppLogException(...) AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
51 #define AppLogTag(tag, ...) AppLogTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
52 #define AppLogDebugTag(tag, ...) AppLogDebugTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
53 #define AppLogExceptionTag(tag, ...) AppLogExceptionTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
55 #define AppLogIf(expression, ...) \
57 AppLogInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
61 #define AppLogDebugIf(expression, ...) \
63 AppLogDebugInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
67 #define AppLogExceptionIf(expression, ...) \
69 AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
73 #define AppAssert(condition) \
75 AppassertInternal(__PRETTY_FUNCTION__, __LINE__); \
79 #define AppAssertf(condition, ...) \
81 AppassertfInternal(# condition, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
84 #else // defined(_APP_LOG)
87 * @addtogroup GroupMacros
92 * This macro allows display of arbitrary messages for future examination.
96 * @param[in] ... The message to display
98 * The following example demonstrates how to use the AppLog macro.
102 * MyEngine::Init(int value)
104 * AppLog("Initialization successful.");
114 * This macro must be added in your program if you want the debug messages to be displayed in the output.
118 * @param[in] ... The message to display
120 * @image html debugging_applog_output.png
122 * The following example demonstrates how to use the AppLogDebug macro.
126 * MyEngine::Init(int value)
128 * AppLogDebug("Invoked with value: %d", value);
132 * AppLogDebug("Exit.");
139 #define AppLogDebug(...)
142 * This macro must be added in your program if you want the exception messages to be displayed in the output.
146 * @param[in] ... The message to display
148 * The following example demonstrates how to use the AppLogException macro.
152 * MyEngine::Init(int value)
154 * AppLogDebug("Invoked with value: %d", value);
156 * if (something_wrong) // The Try family macros can be used instead.
158 * AppLogException("An unexpected error occurred.");
163 * AppLog("Initialization successful.");
164 * AppLogDebug("Exit.");
171 #define AppLogException(...)
174 * This macro is used to check logical errors in a program.
175 * If the assertion fails, the current process is killed.
179 * @param[in] condition The condition that is expected to be true
182 #define AppAssert(condition)
185 * This macro is used to check logical errors in a program.
186 * If the assertion fails, a message is printed on the console and the current process is killed.
190 * @param[in] condition The condition that is expected to be true
191 * @param[in] ... The message to print, if the assertion fails
193 * @image html debugging_appassert.png
195 * The following example demonstrates how to use the Assert macro.
199 * MyClass::DoSomething(void)
201 * result r = E_SUCCESS;
202 * r = mutex.Acquire();
204 * r = mutex.Release();
206 * // If false, console prints "Mutex Release Failed."
207 * // and the process is killed.
208 * AppAssertf(r == E_SUCCESS, "Mutex Release Failed.");
215 #define AppAssertf(condition, ...)
218 * This macro is added in a program to display a message when an expression is @c true.
222 * @param[in] expression The expression to evaluate
223 * @param[in] ... The message to display
225 * The following example demonstrates how to use the AppLogIf macro.
229 * MyEngine::Init(int value)
231 * AppLogIf(value !=0, "Invoked with value: %d", value);
239 #define AppLogIf(expression, ...)
242 * This macro is added in a program to display a debug message when an expression is @c true.
246 * @param[in] expression The expression to evaluate
247 * @param[in] ... The message to display
249 * The following example demonstrates how to use the AppLogDebugIf macro.
253 * MyEngine::Init(int value)
255 * AppLogDebugIf(value !=0, "Invoked with value: %d", value);
263 #define AppLogDebugIf(expression, ...)
266 * This macro is added in a program to display an exception message when an expression is @c true.
270 * @param[in] expression The expression to evaluate
271 * @param[in] ... The message to display
273 * The following example demonstrates how to use the AppLogExceptionIf macro.
277 * MyEngine::Init(int value)
281 * AppLogExceptionIf(status != 0, "status : %d.", status);
289 #define AppLogExceptionIf(expression, ...)
292 * This macro is added in a program to display an info message with a tag.
296 * @param[in] tag Used to identify the source of a log message
297 * @param[in] ... The message to display
299 * The following example demonstrates how to use the AppLogTag macro.
303 * MyEngine::Init(int value)
307 * AppLogTag("MyTag", "Initialization successful.");
315 #define AppLogTag(tag, ...)
318 * This macro is added in a program to display a debug message with a tag.
322 * @param[in] tag Used to identify the source of a log message
323 * @param[in] ... The message to display
325 * The following example demonstrates how to use the AppLogDebugTag macro.
329 * MyEngine::Init(int value)
331 * AppLogDebugTag("MyTag", "Invoked with value: %d", value);
335 * AppLogDebugTag("MyTag", "Exit.");
342 #define AppLogDebugTag(tag, ...)
345 * This macro is added in a program to display an exception message with a tag.
349 * @param[in] tag Used to identify the source of a log message
350 * @param[in] ... The message to display
352 * The following example demonstrates how to use the AppLogExceptionTag macro.
356 * MyEngine::Init(int value)
358 * AppLogDebug("Invoked with value: %d", value);
360 * if (something_wrong) // The Try family macros can be used instead.
362 * AppLogExceptionTag("MyTag", "An unexpected error occurred.");
367 * AppLog("Initialization successful.");
368 * AppLogDebug("Exit.");
375 #define AppLogExceptionTag(tag, ...)
377 #endif // defined(_APP_LOG)
381 * @addtogroup GroupMacros
386 * If the condition is @c false, it prints a message, evaluates a cleanup expression,
387 * and goes to <tt>CATCH</tt>.
391 * @param[in] condition The condition that is expected to be true
392 * @param[in] expr Expressions that are evaluated before going to CATCH label
393 * @param[in] ... The message to display
395 * The following example demonstrates how to use the Try macro.
399 * MyClass::DoSomething(const wchar_t* pValue)
401 * result r = E_SUCCESS;
405 * // If pValue is null, print "pValue == null" to the
406 * // console and return E_INVALID_ARG.
407 * TryCatch(pValue != null, r = E_INVALID_ARG, "pValue == null");
409 * SetLastResult(E_SUCCESS);
421 #define TryCatch(condition, expr, ...) \
422 if (!(condition)) { \
423 AppLogException(__VA_ARGS__); \
430 * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
431 * and goes to <tt>CATCH</tt>.
435 * @param[in] condition The condition that is expected to be true
436 * @param[in] expr Expressions that are evaluated before going to CATCH label
437 * @param[in] r The last result to set
438 * @param[in] ... The message to display
441 #define TryCatchResult(condition, expr, r, ...) \
442 if (!(condition)) { \
444 AppLogException(__VA_ARGS__); \
451 * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
456 * @param[in] condition The condition that is expected to be true
457 * @param[in] expr Expressions that are evaluated before going to catchLabel
458 * @param[in] catchLabel The label for goto operation
459 * @param[in] r The last result to set
460 * @param[in] ... The message to display
463 #define TryCatchLabelResult(condition, expr, catchLabel, r, ...) \
464 if (!(condition)) { \
466 AppLogException(__VA_ARGS__); \
473 * If the condition is @c false, the message is printed and a value is returned.
477 * @param[in] condition The condition that is expected to be true
478 * @param[in] returnValue The value to return when the condition is @c false
479 * @param[in] ... The message to display
482 #define TryReturn(condition, returnValue, ...) \
483 if (!(condition)) { \
484 AppLogException(__VA_ARGS__); \
485 return returnValue; \
490 * If the condition is @c false, the message is printed, sets the last result and a value is returned.
494 * @param[in] condition The condition that is expected to be true
495 * @param[in] returnValue The value to return when the condition is @c false
496 * @param[in] r The last result to set
497 * @param[in] ... The message to display
500 #define TryReturnResult(condition, returnValue, r, ...) \
501 if (!(condition)) { \
503 AppLogException(__VA_ARGS__); \
504 return returnValue; \
509 * If the condition is @c false, the message is printed, sets the last result and no value is returned.
513 * @param[in] condition The condition that is expected to be true
514 * @param[in] r The last result to set
515 * @param[in] ... The message to display
518 #define TryReturnVoidResult(condition, r, ...) \
519 if (!(condition)) { \
521 AppLogException(__VA_ARGS__); \
527 * If the condition is @c false, the message is printed and no value is returned.
531 * @param[in] condition The condition that is expected to be true
532 * @param[in] ... The message to display
535 #define TryReturnVoid(condition, ...) \
536 if (!(condition)) { \
537 AppLogException(__VA_ARGS__); \
543 * If the condition is @c false, the message is printed.
547 * @param[in] condition The condition that is expected to be true
548 * @param[in] ... The message to display
551 #define TryLog(condition, ...) \
552 if (!(condition)) { \
553 AppLog(__VA_ARGS__); \
558 * If the condition is @c false, the informative log message is printed and a value is returned.
562 * @param[in] condition The condition that is expected to be true
563 * @param[in] returnValue The value to return when the condition is @c false
564 * @param[in] ... The message to display
567 #define TryLogReturn(condition, returnValue, ...) \
568 if (!(condition)) { \
569 AppLog(__VA_ARGS__); \
570 return returnValue; \
577 * If the condition is @c false, it prints a message with a tag, evaluates a cleanup expression
578 * and goes to <tt>CATCH</tt>.
582 * @param[in] tag Used to identify the source of a log message
583 * @param[in] condition The condition that is expected to be true
584 * @param[in] expr Expressions that are evaluated before going to CATCH label
585 * @param[in] ... The message to display
588 #define TryCatchTag(tag, condition, expr, ...) \
589 if (!(condition)) { \
590 AppLogExceptionTag(tag, __VA_ARGS__); \
597 * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression,
598 * and goes to <tt>CATCH</tt>.
602 * @param[in] tag Used to identify the source of a log message
603 * @param[in] condition The condition that is expected to be true
604 * @param[in] expr Expressions that are evaluated before going to CATCH label
605 * @param[in] r The last result to set
606 * @param[in] ... The message to display
609 #define TryCatchResultTag(tag, condition, expr, r, ...) \
610 if (!(condition)) { \
612 AppLogExceptionTag(tag, __VA_ARGS__); \
619 * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression
624 * @param[in] tag Used to identify the source of a log message
625 * @param[in] condition The condition that is expected to be true
626 * @param[in] expr Expressions that are evaluated before going to catchLabel
627 * @param[in] catchLabel The label for goto operation
628 * @param[in] r The last result to set
629 * @param[in] ... The message to display
632 #define TryCatchLabelResultTag(tag, condition, expr, catchLabel, r, ...) \
633 if (!(condition)) { \
635 AppLogExceptionTag(tag, __VA_ARGS__); \
642 * If the condition is @c false, the message is printed with a tag and a value is returned.
646 * @param[in] tag Used to identify the source of a log message
647 * @param[in] condition The condition that is expected to be true
648 * @param[in] returnValue The value to return when the condition is @c false
649 * @param[in] ... The message to display
652 #define TryReturnTag(tag, condition, returnValue, ...) \
653 if (!(condition)) { \
654 AppLogExceptionTag(tag, __VA_ARGS__); \
655 return returnValue; \
660 * If the condition is @c false, the message is printed with a tag, sets the last result and a value is returned.
664 * @param[in] tag Used to identify the source of a log message
665 * @param[in] condition The condition that is expected to be true
666 * @param[in] returnValue The value to return when the condition is @c false
667 * @param[in] r The last result to set
668 * @param[in] ... The message to display
671 #define TryReturnResultTag(tag, condition, returnValue, r, ...) \
672 if (!(condition)) { \
674 AppLogExceptionTag(tag, __VA_ARGS__); \
675 return returnValue; \
680 * If the condition is @c false, the message is printed with a tag, sets the last result and no value is returned.
684 * @param[in] tag Used to identify the source of a log message
685 * @param[in] condition The condition that is expected to be true
686 * @param[in] r The last result to set
687 * @param[in] ... The message to display
690 #define TryReturnVoidResultTag(tag, condition, r, ...) \
691 if (!(condition)) { \
693 AppLogExceptionTag(tag, __VA_ARGS__); \
699 * If the condition is @c false, the message is printed with a tag and no value is returned.
703 * @param[in] tag Used to identify the source of a log message
704 * @param[in] condition The condition that is expected to be true
705 * @param[in] ... The message to display
708 #define TryReturnVoidTag(tag, condition, ...) \
709 if (!(condition)) { \
710 AppLogExceptionTag(tag, __VA_ARGS__); \
716 * If the condition is @c false, the message is printed with a tag.
720 * @param[in] tag Used to identify the source of a log message
721 * @param[in] condition The condition that is expected to be true
722 * @param[in] ... The message to display
725 #define TryLogTag(tag, condition, ...) \
726 if (!(condition)) { \
727 AppLogTag(tag, __VA_ARGS__); \
732 * If the condition is @c false, the informative log message is printed with a tag and a value is returned.
736 * @param[in] tag Used to identify the source of a log message
737 * @param[in] condition The condition that is expected to be true
738 * @param[in] returnValue The value to return when the condition is @c false
739 * @param[in] ... The message to display
742 #define TryLogReturnTag(tag, condition, returnValue, ...) \
743 if (!(condition)) { \
744 AppLogTag(tag, __VA_ARGS__); \
745 return returnValue; \
754 * @addtogroup GroupMacros
759 #if (defined(_APP_LOG) || defined(_OSP_DEBUG_) || defined(_DEBUG)) && defined(_SECURE_LOG)
761 #define AppSecureLog(...) AppLogInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
762 #define AppSecureLogDebug(...) AppLogDebugInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
763 #define AppSecureLogException(...) AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
765 #define AppSecureLogTag(tag, ...) AppLogTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
766 #define AppSecureLogDebugTag(tag, ...) AppLogDebugTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
767 #define AppSecureLogExceptionTag(tag, ...) AppLogExceptionTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
771 * This macro is to protect informative log messages which needs to keep security.
772 * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
773 * Otherwise, it will be removed in the compile time.
777 * @param[in] ... The message to display
779 * The following example demonstrates how to use the AppSecureLog macro.
783 * MyEngine::Init(int value)
785 * AppSecureLog("User ID : 'JoneDoe'");
792 #define AppSecureLog(...)
795 * This macro is to protect debug log messages which needs to keep security.
796 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
797 * Otherwise, it will be removed in the compile time.
801 * @param[in] ... The message to display
803 * The following example demonstrates how to use the AppSecureLogDebug macro.
807 * MyEngine::Init(int value)
810 * if (something_wrong)
812 * AppSecureLogDebug("User ID : 'JoneDoe' mismatch.");
823 #define AppSecureLogDebug(...)
826 * This macro is to protect exception log messages which needs to keep security.
827 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
828 * Otherwise, it will be removed in the compile time.
832 * @param[in] ... The message to display
834 * The following example demonstrates how to use the AppSecureLogException macro.
838 * MyEngine::Init(int value)
841 * if (something_wrong)
843 * AppSecureLogException("User ID : 'JoneDoe' mismatch.");
854 #define AppSecureLogException(...)
857 * This macro is to protect informative log messages which needs to keep security, with a tag.
858 * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
859 * Otherwise, it will be removed in the compile time.
863 * @param[in] tag The user defined tag
864 * @param[in] ... The message to display
866 * The following example demonstrates how to use the AppSecureLogTag macro.
870 * MyEngine::Init(int value)
872 * AppSecureLogTag("MyTag", "User ID : 'JoneDoe'");
879 #define AppSecureLogTag(tag, ...)
882 * This macro is to protect debug log messages which needs to keep security, with a tag.
883 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
884 * Otherwise, it will be removed in the compile time.
888 * @param[in] tag The user defined tag
889 * @param[in] ... The message to display
891 * The following example demonstrates how to use the AppSecureLogDebugTag macro.
895 * MyEngine::Init(int value)
897 * AppSecureLogDebugTag("MyTag", "User ID : 'JoneDoe' mismatch.");
904 #define AppSecureLogDebugTag(tag, ...)
907 * This macro is to protect exception log messages which needs to keep security, with a tag.
908 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
909 * Otherwise, it will be removed in the compile time.
913 * @param[in] tag The user defined tag
914 * @param[in] ... The message to display
916 * The following example demonstrates how to use the AppSecureLogExceptionTag macro.
920 * MyEngine::Init(int value)
922 * AppSecureLogExceptionTag("MyTag", "User ID : 'JoneDoe' mismatch.");
929 #define AppSecureLogExceptionTag(tag, ...)
934 * If the condition is @c false, it prints a message, evaluates a cleanup expression,
935 * and goes to <tt>CATCH</tt>.
936 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
937 * Otherwise, log printing functionality will be removed in the compile time.
941 * @param[in] condition The condition that is expected to be true
942 * @param[in] expr Expressions that are evaluated before going to CATCH label
943 * @param[in] ... The message to display
945 * The following example demonstrates how to use the SecureTry macro.
949 * MyClass::DoSomething(const String* passwd)
951 * result r = E_SUCCESS;
955 * // If password is wrong, print "[E_INVALID_ARG] The password '1234' is wrong." to the console
956 * // execute the expression "r = E_INVALID_ARG", and move to CATCH
957 * SecureTryCatch(*passwd != refPasswd, r = E_INVALID_ARG, "[E_INVALID_ARG] The password '%ls' is wrong.", passwd->GetPointer());
959 * SetLastResult(E_SUCCESS);
961 * return E_SUCCESS;// execute the expression "r = E_INVALID_ARG", and move to CATCH
972 #define SecureTryCatch(condition, expr, ...) \
973 if (!(condition)) { \
974 AppSecureLogException(__VA_ARGS__); \
981 * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
982 * and goes to <tt>CATCH</tt>.
983 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
984 * Otherwise, log printing functionality will be removed in the compile time.
988 * @param[in] condition The condition that is expected to be true
989 * @param[in] expr Expressions that are evaluated before going to CATCH label
990 * @param[in] r The last result to set
991 * @param[in] ... The message to display
994 #define SecureTryCatchResult(condition, expr, r, ...) \
995 if (!(condition)) { \
997 AppSecureLogException(__VA_ARGS__); \
1004 * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
1005 * and goes to label.
1006 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1007 * Otherwise, log printing functionality will be removed in the compile time.
1011 * @param[in] condition The condition that is expected to be true
1012 * @param[in] expr Expressions that are evaluated before going to catchLabel
1013 * @param[in] catchLabel The label for goto operation
1014 * @param[in] r The last result to set
1015 * @param[in] ... The message to display
1018 #define SecureTryCatchLabelResult(condition, expr, catchLabel, r, ...) \
1019 if (!(condition)) { \
1021 AppSecureLogException(__VA_ARGS__); \
1028 * If the condition is @c false, the message is printed and a value is returned.
1029 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1030 * Otherwise, log printing functionality will be removed in the compile time.
1034 * @param[in] condition The condition that is expected to be true
1035 * @param[in] returnValue The value to return when the condition is @c false
1036 * @param[in] ... The message to display
1039 #define SecureTryReturn(condition, returnValue, ...) \
1040 if (!(condition)) { \
1041 AppSecureLogException(__VA_ARGS__); \
1042 return returnValue; \
1047 * If the condition is @c false, the message is printed, sets the last result and a value is returned.
1048 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1049 * Otherwise, log printing functionality will be removed in the compile time.
1053 * @param[in] condition The condition that is expected to be true
1054 * @param[in] returnValue The value to return when the condition is @c false
1055 * @param[in] r The last result to set
1056 * @param[in] ... The message to display
1059 #define SecureTryReturnResult(condition, returnValue, r, ...) \
1060 if (!(condition)) { \
1062 AppSecureLogException(__VA_ARGS__); \
1063 return returnValue; \
1068 * If the condition is @c false, the message is printed, sets the last result and no value is returned.
1069 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1070 * Otherwise, log printing functionality will be removed in the compile time.
1074 * @param[in] condition The condition that is expected to be true
1075 * @param[in] r The last result to set
1076 * @param[in] ... The message to display
1079 #define SecureTryReturnVoidResult(condition, r, ...) \
1080 if (!(condition)) { \
1082 AppSecureLogException(__VA_ARGS__); \
1088 * If the condition is @c false, the message is printed and no value is returned.
1089 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1090 * Otherwise, log printing functionality will be removed in the compile time.
1094 * @param[in] condition The condition that is expected to be true
1095 * @param[in] ... The message to display
1098 #define SecureTryReturnVoid(condition, ...) \
1099 if (!(condition)) { \
1100 AppSecureLogException(__VA_ARGS__); \
1106 * If the condition is @c false, the message is printed.
1107 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1108 * Otherwise, log printing functionality will be removed in the compile time.
1112 * @param[in] condition The condition that is expected to be true
1113 * @param[in] ... The message to display
1116 #define SecureTryLog(condition, ...) \
1117 if (!(condition)) { \
1118 AppSecureLog(__VA_ARGS__); \
1123 * If the condition is @c false, the informative log message is printed and a value is returned.
1124 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1125 * Otherwise, log printing functionality will be removed in the compile time.
1129 * @param[in] condition The condition that is expected to be true
1130 * @param[in] returnValue The value to return when the condition is @c false
1131 * @param[in] ... The message to display
1134 #define SecureTryLogReturn(condition, returnValue, ...) \
1135 if (!(condition)) { \
1136 AppSecureLog(__VA_ARGS__); \
1137 return returnValue; \
1141 // SecureTryTag Macros
1144 * If the condition is @c false, it prints a message with a tag, evaluates a cleanup expression
1145 * and goes to <tt>CATCH</tt>.
1146 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1147 * Otherwise, log printing functionality will be removed in the compile time.
1151 * @param[in] tag Used to identify the source of a log message
1152 * @param[in] condition The condition that is expected to be true
1153 * @param[in] expr Expressions that are evaluated before going to CATCH label
1154 * @param[in] ... The message to display
1157 #define SecureTryCatchTag(tag, condition, expr, ...) \
1158 if (!(condition)) { \
1159 AppSecureLogExceptionTag(tag, __VA_ARGS__); \
1166 * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression,
1167 * and goes to <tt>CATCH</tt>.
1168 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1169 * Otherwise, log printing functionality will be removed in the compile time.
1173 * @param[in] tag Used to identify the source of a log message
1174 * @param[in] condition The condition that is expected to be true
1175 * @param[in] expr Expressions that are evaluated before going to CATCH label
1176 * @param[in] r The last result to set
1177 * @param[in] ... The message to display
1180 #define SecureTryCatchResultTag(tag, condition, expr, r, ...) \
1181 if (!(condition)) { \
1183 AppSecureLogExceptionTag(tag, __VA_ARGS__); \
1190 * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression
1191 * and goes to label.
1192 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1193 * Otherwise, log printing functionality will be removed in the compile time.
1197 * @param[in] tag Used to identify the source of a log message
1198 * @param[in] condition The condition that is expected to be true
1199 * @param[in] expr Expressions that are evaluated before going to catchLabel
1200 * @param[in] catchLabel The label for goto operation
1201 * @param[in] r The last result to set
1202 * @param[in] ... The message to display
1205 #define SecureTryCatchLabelResultTag(tag, condition, expr, catchLabel, r, ...) \
1206 if (!(condition)) { \
1208 AppSecureLogExceptionTag(tag, __VA_ARGS__); \
1215 * If the condition is @c false, the message is printed with a tag and a value is returned.
1216 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1217 * Otherwise, log printing functionality will be removed in the compile time.
1221 * @param[in] tag Used to identify the source of a log message
1222 * @param[in] condition The condition that is expected to be true
1223 * @param[in] returnValue The value to return when the condition is @c false
1224 * @param[in] ... The message to display
1227 #define SecureTryReturnTag(tag, condition, returnValue, ...) \
1228 if (!(condition)) { \
1229 AppSecureLogExceptionTag(tag, __VA_ARGS__); \
1230 return returnValue; \
1235 * If the condition is @c false, the message is printed with a tag, sets the last result and a value is returned.
1236 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1237 * Otherwise, log printing functionality will be removed in the compile time.
1241 * @param[in] tag Used to identify the source of a log message
1242 * @param[in] condition The condition that is expected to be true
1243 * @param[in] returnValue The value to return when the condition is @c false
1244 * @param[in] r The last result to set
1245 * @param[in] ... The message to display
1248 #define SecureTryReturnResultTag(tag, condition, returnValue, r, ...) \
1249 if (!(condition)) { \
1251 AppSecureLogExceptionTag(tag, __VA_ARGS__); \
1252 return returnValue; \
1257 * If the condition is @c false, the message is printed with a tag, sets the last result and no value is returned.
1258 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1259 * Otherwise, log printing functionality will be removed in the compile time.
1263 * @param[in] tag Used to identify the source of a log message
1264 * @param[in] condition The condition that is expected to be true
1265 * @param[in] r The last result to set
1266 * @param[in] ... The message to display
1269 #define SecureTryReturnVoidResultTag(tag, condition, r, ...) \
1270 if (!(condition)) { \
1272 AppSecureLogExceptionTag(tag, __VA_ARGS__); \
1278 * If the condition is @c false, the message is printed with a tag and no value is returned.
1279 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1280 * Otherwise, log printing functionality will be removed in the compile time.
1284 * @param[in] tag Used to identify the source of a log message
1285 * @param[in] condition The condition that is expected to be true
1286 * @param[in] ... The message to display
1289 #define SecureTryReturnVoidTag(tag, condition, ...) \
1290 if (!(condition)) { \
1291 AppSecureLogExceptionTag(tag, __VA_ARGS__); \
1297 * If the condition is @c false, the message is printed with a tag.
1298 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1299 * Otherwise, log printing functionality will be removed in the compile time.
1303 * @param[in] tag Used to identify the source of a log message
1304 * @param[in] condition The condition that is expected to be true
1305 * @param[in] ... The message to display
1308 #define SecureTryLogTag(tag, condition, ...) \
1309 if (!(condition)) { \
1310 AppSecureLogTag(tag, __VA_ARGS__); \
1315 * If the condition is @c false, the informative log message is printed with a tag and a value is returned.
1316 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
1317 * Otherwise, log printing functionality will be removed in the compile time.
1321 * @param[in] tag Used to identify the source of a log message
1322 * @param[in] condition The condition that is expected to be true
1323 * @param[in] returnValue The value to return when the condition is @c false
1324 * @param[in] ... The message to display
1327 #define SecureTryLogReturnTag(tag, condition, returnValue, ...) \
1328 if (!(condition)) { \
1329 AppSecureLogTag(tag, __VA_ARGS__); \
1330 return returnValue; \
1336 _OSP_EXPORT_ void AppLogInternal(const char* pFunction, int lineNumber, const char* pFormat, ...);
1337 _OSP_EXPORT_ void AppLogDebugInternal(const char* pFunction, int lineNumber, const char* pFormat, ...);
1338 _OSP_EXPORT_ void AppLogExceptionInternal(const char* pFunction, int lineNumber, const char* pFormat, ...);
1339 _OSP_EXPORT_ void AppassertInternal(const char* pFunction, int lineNumber);
1340 _OSP_EXPORT_ void AppassertfInternal(const char* expr, const char* pFunction, int lineNumber, const char* pFormat, ...);
1342 _OSP_EXPORT_ void AppLogTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
1343 _OSP_EXPORT_ void AppLogDebugTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
1344 _OSP_EXPORT_ void AppLogExceptionTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
1350 #endif // _FBASE_LOG_H_