Update the size check in MessagePort
[platform/framework/native/appfw.git] / inc / FBaseLog.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                FBaseLog.h
20  * @brief               This is the header file for the diagnostic types.
21  *
22  * This header file defines the diagnostic types.
23  *
24  */
25 #ifndef _FBASE_LOG_H_
26 #define _FBASE_LOG_H_
27
28 #include <new>
29 #include <FOspConfig.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /**
36  * @defgroup GroupMacros Debugging Macros
37  *
38  * This page describes Tizen debugging macros.
39  *
40  * @since 2.0
41  */
42
43 #if defined(_APP_LOG) || defined(_OSP_DEBUG_) || defined(_DEBUG)
44
45 // AppLog Macro
46
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__)
50
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__)
54
55 #define AppLogIf(expression, ...) \
56         if (expression) { \
57                 AppLogInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__);     \
58         } \
59         else {;}
60
61 #define AppLogDebugIf(expression, ...) \
62         if (expression) { \
63                 AppLogDebugInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
64         } \
65         else {;}
66
67 #define AppLogExceptionIf(expression, ...) \
68         if (expression) { \
69                 AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
70         } \
71         else {;}
72
73 #define AppAssert(condition) \
74         if (!(condition)) { \
75                 AppassertInternal(__PRETTY_FUNCTION__, __LINE__); \
76         } \
77         else {;}
78
79 #define AppAssertf(condition, ...)      \
80         if (!(condition)) { \
81                 AppassertfInternal(# condition, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
82         } \
83         else {;}
84 #else // defined(_APP_LOG)
85
86 /**
87  * @addtogroup  GroupMacros
88  *
89  * @{
90  */
91 /**
92  * This macro allows display of arbitrary messages for future examination.
93  *
94  * @since 2.0
95  *
96  * @param[in]   ...                     The message to display
97  *
98  * The following example demonstrates how to use the AppLog macro.
99  *
100  * @code
101  *      bool
102  *      MyEngine::Init(int value)
103  *      {
104  *         AppLog("Initialization successful.");
105  *
106  *         return true;
107  *      }
108  * @endcode
109  * @hideinitializer
110  */
111 #define AppLog(...)
112
113 /**
114  * This macro must be added in your program if you want the debug messages to be displayed in the output.
115  *
116  * @since 2.0
117  *
118  * @param[in]   ...                     The message to display
119  *
120  *  @image html debugging_applog_output.png
121  *
122  * The following example demonstrates how to use the AppLogDebug macro.
123  *
124  * @code
125  *      bool
126  *      MyEngine::Init(int value)
127  *      {
128  *         AppLogDebug("Invoked with value: %d", value);
129  *
130  *         //...
131  *
132  *         AppLogDebug("Exit.");
133  *
134  *         return true;
135  *      }
136  * @endcode
137  * @hideinitializer
138  */
139 #define AppLogDebug(...)
140
141 /**
142  * This macro must be added in your program if you want the exception messages to be displayed in the output.
143  *
144  * @since 2.0
145  *
146  * @param[in]   ...                     The message to display
147  *
148  * The following example demonstrates how to use the AppLogException macro.
149  *
150  * @code
151  *      bool
152  *      MyEngine::Init(int value)
153  *      {
154  *         AppLogDebug("Invoked with value: %d", value);
155  *         //...
156  *         if (something_wrong)   // The Try family macros can be used instead.
157  *         {
158  *            AppLogException("An unexpected error occurred.");
159  *
160  *            return false;
161  *         }
162  *
163  *         AppLog("Initialization successful.");
164  *         AppLogDebug("Exit.");
165  *
166  *         return true;
167  *      }
168  * @endcode
169  * @hideinitializer
170  */
171 #define AppLogException(...)
172
173 /**
174  * This macro is used to check logical errors in a program.
175  * If the assertion fails, the current process is killed.
176  *
177  * @since 2.0
178  *
179  * @param[in]   condition  The condition that is expected to be true
180  * @hideinitializer
181  */
182 #define AppAssert(condition)
183
184 /**
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.
187  *
188  * @since 2.0
189  *
190  * @param[in]   condition               The condition that is expected to be true
191  * @param[in]   ...                     The message to print, if the assertion fails
192  *
193  * @image html debugging_appassert.png
194  *
195  * The following example demonstrates how to use the Assert macro.
196  *
197  * @code
198  *      result
199  *      MyClass::DoSomething(void)
200  *      {
201  *         result r = E_SUCCESS;
202  *         r = mutex.Acquire();
203  *         // Do something
204  *         r = mutex.Release();
205  *
206  *         // If false, console prints "Mutex Release Failed."
207  *         // and the process is killed.
208  *         AppAssertf(r == E_SUCCESS, "Mutex Release Failed.");
209  *
210  *         return r;
211  *      }
212  * @endcode
213  * @hideinitializer
214  */
215 #define AppAssertf(condition, ...)
216
217 /**
218  * This macro is added in a program to display a message when an expression is @c true.
219  *
220  * @since 2.0
221  *
222  * @param[in]   expression              The expression to evaluate
223  * @param[in]   ...                     The message to display
224  *
225  * The following example demonstrates how to use the AppLogIf macro.
226  *
227  * @code
228  *      bool
229  *      MyEngine::Init(int value)
230  *      {
231  *         AppLogIf(value !=0, "Invoked with value: %d", value);
232  *         //...
233  *
234  *         return true;
235  *      }
236  * @endcode
237  * @hideinitializer
238  */
239 #define AppLogIf(expression, ...)
240
241 /**
242  * This macro is added in a program to display a debug message when an expression is @c true.
243  *
244  * @since 2.0
245  *
246  * @param[in]   expression              The expression to evaluate
247  * @param[in]   ...                     The message to display
248  *
249  * The following example demonstrates how to use the AppLogDebugIf macro.
250  *
251  * @code
252  *      bool
253  *      MyEngine::Init(int value)
254  *      {
255  *         AppLogDebugIf(value !=0, "Invoked with value: %d", value);
256  *         //...
257  *
258  *         return true;
259  *      }
260  * @endcode
261  * @hideinitializer
262  */
263 #define AppLogDebugIf(expression, ...)
264
265 /**
266  * This macro is added in a program to display an exception message when an expression is @c true.
267  *
268  * @since 2.0
269  *
270  * @param[in]   expression              The expression to evaluate
271  * @param[in]   ...                     The message to display
272  *
273  * The following example demonstrates how to use the AppLogExceptionIf macro.
274  *
275  * @code
276  *      bool
277  *      MyEngine::Init(int value)
278  *      {
279  *         int status;
280  *
281  *         AppLogExceptionIf(status != 0, "status : %d.", status);
282  *         //...
283  *
284  *         return true;
285  *      }
286  * @endcode
287  * @hideinitializer
288  */
289 #define AppLogExceptionIf(expression, ...)
290
291 /**
292  * This macro is added in a program to display an info message with a tag.
293  *
294  * @since 2.0
295  *
296  * @param[in]   tag                     Used to identify the source of a log message
297  * @param[in]   ...                     The message to display
298  *
299  * The following example demonstrates how to use the AppLogTag macro.
300  *
301  * @code
302  *      bool
303  *      MyEngine::Init(int value)
304  *      {
305  *         int status;
306  *
307  *         AppLogTag("MyTag", "Initialization successful.");
308  *         //...
309  *
310  *         return true;
311  *      }
312  * @endcode
313  * @hideinitializer
314  */
315 #define AppLogTag(tag, ...)
316
317 /**
318  * This macro is added in a program to display a debug message with a tag.
319  *
320  * @since 2.0
321  *
322  * @param[in]   tag                     Used to identify the source of a log message
323  * @param[in]   ...                     The message to display
324  *
325  * The following example demonstrates how to use the AppLogDebugTag macro.
326  *
327   * @code
328  *      bool
329  *      MyEngine::Init(int value)
330  *      {
331  *         AppLogDebugTag("MyTag", "Invoked with value: %d", value);
332  *
333  *         //...
334  *
335  *         AppLogDebugTag("MyTag", "Exit.");
336  *
337  *         return true;
338  *      }
339  * @endcode
340  * @hideinitializer
341  */
342 #define AppLogDebugTag(tag, ...)
343
344 /**
345  * This macro is added in a program to display an exception message with a tag.
346  *
347  * @since 2.0
348  *
349  * @param[in]   tag                     Used to identify the source of a log message
350  * @param[in]   ...                     The message to display
351  *
352  * The following example demonstrates how to use the AppLogExceptionTag macro.
353  *
354  * @code
355  *      bool
356  *      MyEngine::Init(int value)
357  *      {
358  *         AppLogDebug("Invoked with value: %d", value);
359  *         //...
360  *         if (something_wrong)   // The Try family macros can be used instead.
361  *         {
362  *            AppLogExceptionTag("MyTag", "An unexpected error occurred.");
363  *
364  *            return false;
365  *         }
366  *
367  *         AppLog("Initialization successful.");
368  *         AppLogDebug("Exit.");
369  *
370  *         return true;
371  *      }
372  * @endcode
373  * @hideinitializer
374  */
375 #define AppLogExceptionTag(tag, ...)
376 /** @} */
377 #endif // defined(_APP_LOG)
378
379 // Try Macros
380 /**
381  * @addtogroup  GroupMacros
382  *
383  * @{
384  */
385 /**
386  * If the condition is @c false, it prints a message, evaluates a cleanup expression,
387  * and goes to <tt>CATCH</tt>.
388  *
389  * @since 2.0
390  *
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
394  *
395  * The following example demonstrates how to use the Try macro.
396  *
397  * @code
398  *      const  A*
399  *      MyClass::DoSomething(const wchar_t* pValue)
400  *      {
401  *         result r = E_SUCCESS;
402  *
403  *         // Do something...
404  *
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");
408  *
409  *         SetLastResult(E_SUCCESS);
410  *
411  *         return _pValue;
412  *
413  *         CATCH:
414  *            SetLastResult(r);
415  *
416  *            return null;
417  *      }
418  * @endcode
419  * @hideinitializer
420  */
421 #define TryCatch(condition, expr, ...) \
422         if (!(condition)) { \
423                 AppLogException(__VA_ARGS__); \
424                 expr; \
425                 goto CATCH;     \
426         } \
427         else {;}
428
429 /**
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>.
432  *
433  * @since 2.0
434  *
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
439  * @hideinitializer
440  */
441 #define TryCatchResult(condition, expr, r, ...) \
442         if (!(condition)) { \
443                 SetLastResult(r); \
444                 AppLogException(__VA_ARGS__); \
445                 expr; \
446                 goto CATCH;     \
447         } \
448         else {;}
449
450 /**
451 * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
452 * and goes to label.
453 *
454 * @since 2.1
455 *
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
461 * @hideinitializer
462 */
463 #define TryCatchLabelResult(condition, expr, catchLabel, r, ...) \
464         if (!(condition)) { \
465                 SetLastResult(r); \
466                 AppLogException(__VA_ARGS__); \
467                 expr; \
468                 goto catchLabel;        \
469         } \
470         else {;}
471
472 /**
473  * If the condition is @c false, the message is printed and a value is returned.
474  *
475  * @since 2.0
476  *
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
480  * @hideinitializer
481  */
482 #define TryReturn(condition, returnValue, ...)  \
483         if (!(condition)) { \
484                 AppLogException(__VA_ARGS__); \
485                 return returnValue;     \
486         } \
487         else {;}
488
489 /**
490  * If the condition is @c false, the message is printed, sets the last result and a value is returned.
491  *
492  * @since 2.0
493  *
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
498  * @hideinitializer
499  */
500 #define TryReturnResult(condition, returnValue, r, ...) \
501         if (!(condition)) { \
502                 SetLastResult(r); \
503                 AppLogException(__VA_ARGS__); \
504                 return returnValue;     \
505         } \
506         else {;}
507
508 /**
509  * If the condition is @c false, the message is printed, sets the last result and no value is returned.
510  *
511  * @since 2.0
512  *
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
516  * @hideinitializer
517  */
518 #define TryReturnVoidResult(condition, r, ...)  \
519         if (!(condition)) { \
520                 SetLastResult(r); \
521                 AppLogException(__VA_ARGS__); \
522                 return; \
523         } \
524         else {;}
525
526 /**
527  * If the condition is @c false, the message is printed and no value is returned.
528  *
529  * @since 2.0
530  *
531  * @param[in]   condition               The condition that is expected to be true
532  * @param[in]   ...                     The message to display
533  * @hideinitializer
534  */
535 #define TryReturnVoid(condition, ...) \
536         if (!(condition)) { \
537                 AppLogException(__VA_ARGS__); \
538                 return; \
539         } \
540         else {;}
541
542 /**
543  * If the condition is @c false, the message is printed.
544  *
545  * @since 2.0
546  *
547  * @param[in]   condition               The condition that is expected to be true
548  * @param[in]   ...                     The message to display
549  * @hideinitializer
550  */
551 #define TryLog(condition, ...)  \
552         if (!(condition)) { \
553                 AppLog(__VA_ARGS__); \
554         } \
555         else {;}
556
557 /**
558 * If the condition is @c false, the informative log message is printed and a value is returned.
559 *
560 * @since 2.1
561 *
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
565 * @hideinitializer
566 */
567 #define TryLogReturn(condition, returnValue, ...) \
568         if (!(condition)) { \
569                 AppLog(__VA_ARGS__); \
570                 return returnValue;     \
571         } \
572         else {;}
573
574 // TryTag Macros
575
576 /**
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>.
579  *
580  * @since 2.0
581  *
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
586  * @hideinitializer
587  */
588 #define TryCatchTag(tag, condition, expr, ...) \
589         if (!(condition)) { \
590                 AppLogExceptionTag(tag, __VA_ARGS__); \
591                 expr; \
592                 goto CATCH;     \
593         } \
594         else {;}
595
596 /**
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>.
599  *
600  * @since 2.0
601  *
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
607  * @hideinitializer
608  */
609 #define TryCatchResultTag(tag, condition, expr, r, ...) \
610         if (!(condition)) { \
611                 SetLastResult(r); \
612                 AppLogExceptionTag(tag, __VA_ARGS__); \
613                 expr; \
614                 goto CATCH;     \
615         } \
616         else {;}
617
618 /**
619 * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression
620 * and goes to label.
621 *
622 * @since 2.1
623 *
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
630 * @hideinitializer
631 */
632 #define TryCatchLabelResultTag(tag, condition, expr, catchLabel, r, ...) \
633         if (!(condition)) { \
634                 SetLastResult(r); \
635                 AppLogExceptionTag(tag, __VA_ARGS__); \
636                 expr; \
637                 goto catchLabel;        \
638         } \
639         else {;}
640
641 /**
642  * If the condition is @c false, the message is printed with a tag and a value is returned.
643  *
644  * @since 2.0
645  *
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
650  * @hideinitializer
651  */
652 #define TryReturnTag(tag, condition, returnValue, ...)  \
653         if (!(condition)) { \
654                 AppLogExceptionTag(tag, __VA_ARGS__); \
655                 return returnValue;     \
656         } \
657         else {;}
658
659 /**
660  * If the condition is @c false, the message is printed with a tag, sets the last result and a value is returned.
661  *
662  * @since 2.0
663  *
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
669  * @hideinitializer
670  */
671 #define TryReturnResultTag(tag, condition, returnValue, r, ...) \
672         if (!(condition)) { \
673                 SetLastResult(r); \
674                 AppLogExceptionTag(tag, __VA_ARGS__); \
675                 return returnValue;     \
676         } \
677         else {;}
678
679 /**
680  * If the condition is @c false, the message is printed with a tag, sets the last result and no value is returned.
681  *
682  * @since 2.0
683  *
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
688  * @hideinitializer
689  */
690 #define TryReturnVoidResultTag(tag, condition, r, ...)  \
691         if (!(condition)) { \
692                 SetLastResult(r); \
693                 AppLogExceptionTag(tag, __VA_ARGS__); \
694                 return; \
695         } \
696         else {;}
697
698 /**
699  * If the condition is @c false, the message is printed with a tag and no value is returned.
700  *
701  * @since 2.0
702  *
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
706  * @hideinitializer
707  */
708 #define TryReturnVoidTag(tag, condition, ...) \
709         if (!(condition)) { \
710                 AppLogExceptionTag(tag, __VA_ARGS__); \
711                 return; \
712         } \
713         else {;}
714
715 /**
716  * If the condition is @c false, the message is printed with a tag.
717  *
718  * @since 2.0
719  *
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
723  * @hideinitializer
724  */
725 #define TryLogTag(tag, condition, ...)  \
726         if (!(condition)) { \
727                 AppLogTag(tag, __VA_ARGS__); \
728         } \
729         else {;}
730
731 /**
732 * If the condition is @c false, the informative log message is printed with a tag and a value is returned.
733 *
734 * @since 2.1
735 *
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
740 * @hideinitializer
741 */
742 #define TryLogReturnTag(tag, condition, returnValue, ...) \
743         if (!(condition)) { \
744                 AppLogTag(tag, __VA_ARGS__); \
745                 return returnValue;     \
746         } \
747         else {;}
748
749 /** @} */
750
751
752 // Secure Macros
753 /**
754  * @addtogroup  GroupMacros
755  *
756  * @{
757  */
758 #if (defined(_APP_LOG) || defined(_OSP_DEBUG_) || defined(_DEBUG)) && defined(_SECURE_LOG)
759
760 #define AppSecureLog(...)                       AppLogInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
761 #define AppSecureLogException(...)              AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
762
763 #define AppSecureLogTag(tag, ...)               AppLogTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
764 #define AppSecureLogExceptionTag(tag, ...)      AppLogExceptionTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
765
766 #else
767 /**
768 * This macro is to protect informative log messages which needs to keep security.
769 * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
770 * Otherwise, it will be removed in the compile time.
771 *
772 * @since 2.1
773 *
774 * @param[in]    ...                     The message to display
775 *
776 * The following example demonstrates how to use the AppSecureLog macro.
777 *
778 * @code
779 *        bool
780 *        MyEngine::Init(int value)
781 *        {
782 *           AppSecureLog("User ID : 'JoneDoe'");
783 *
784 *           return true;
785 *        }
786 * @endcode
787 * @hideinitializer
788 */
789 #define AppSecureLog(...)
790
791 /**
792 * This macro is to protect exception log messages which needs to keep security.
793 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
794 * Otherwise, it will be removed in the compile time.
795 *
796 * @since 2.1
797 *
798 * @param[in]    ...                     The message to display
799 *
800 * The following example demonstrates how to use the AppSecureLogException macro.
801 *
802 * @code
803 *        bool
804 *        MyEngine::Init(int value)
805 *        {
806 *           //...
807 *           if (something_wrong)
808 *           {
809 *              AppSecureLogException("User ID : 'JoneDoe' mismatch.");
810 *
811 *              return false;
812 *           }
813 *   //...
814 *
815 *           return true;
816 *        }
817 * @endcode
818 * @hideinitializer
819 */
820 #define AppSecureLogException(...)
821
822 /**
823 * This macro is to protect informative log messages which needs to keep security, with a tag.
824 * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
825 * Otherwise, it will be removed in the compile time.
826 *
827 * @since 2.1
828 *
829 * @param[in]    tag                     The user defined tag
830 * @param[in]    ...                     The message to display
831 *
832 * The following example demonstrates how to use the AppSecureLogTag macro.
833 *
834 * @code
835 *        bool
836 *        MyEngine::Init(int value)
837 *        {
838 *           AppSecureLogTag("MyTag", "User ID : 'JoneDoe'");
839 *
840 *           return true;
841 *        }
842 * @endcode
843 * @hideinitializer
844 */
845 #define AppSecureLogTag(tag, ...)
846
847 /**
848 * This macro is to protect exception log messages which needs to keep security, with a tag.
849 * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
850 * Otherwise, it will be removed in the compile time.
851 *
852 * @since 2.1
853 *
854 * @param[in]    tag                     The user defined tag
855 * @param[in]    ...                     The message to display
856 *
857 * The following example demonstrates how to use the AppSecureLogExceptionTag macro.
858 *
859 * @code
860 *        bool
861 *        MyEngine::Init(int value)
862 *        {
863 *           AppSecureLogExceptionTag("MyTag", "User ID : 'JoneDoe' mismatch.");
864 *
865 *           return true;
866 *        }
867 * @endcode
868 * @hideinitializer
869 */
870 #define AppSecureLogExceptionTag(tag, ...)
871
872 #endif
873 /** @} */
874
875 _OSP_EXPORT_ void AppLogInternal(const char* pFunction, int lineNumber, const char* pFormat, ...);
876 _OSP_EXPORT_ void AppLogDebugInternal(const char* pFunction, int lineNumber, const char* pFormat, ...);
877 _OSP_EXPORT_ void AppLogExceptionInternal(const char* pFunction, int lineNumber, const char* pFormat, ...);
878 _OSP_EXPORT_ void AppassertInternal(const char* pFunction, int lineNumber);
879 _OSP_EXPORT_ void AppassertfInternal(const char* expr, const char* pFunction, int lineNumber, const char* pFormat, ...);
880
881 _OSP_EXPORT_ void AppLogTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
882 _OSP_EXPORT_ void AppLogDebugTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
883 _OSP_EXPORT_ void AppLogExceptionTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
884
885
886 #ifdef __cplusplus
887 }
888 #endif
889
890 #endif // _FBASE_LOG_H_