diff options
Diffstat (limited to 'common/include/debug.h')
-rwxr-xr-x | common/include/debug.h | 76 |
1 files changed, 53 insertions, 23 deletions
diff --git a/common/include/debug.h b/common/include/debug.h index 4f6bf64..daa8583 100755 --- a/common/include/debug.h +++ b/common/include/debug.h @@ -1,19 +1,18 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef __ELM_MYPHOTOCAM_DEBUG_H__ #define __ELM_MYPHOTOCAM_DEBUG_H__ @@ -97,6 +96,8 @@ enum extern "C" { #endif +#undef DISABLE_LOG + // Time analyzer #define DEFINE_PERFORM_TIME(aa) long aa = 0; struct timeval tv @@ -122,7 +123,19 @@ typedef struct { unsigned long time; } debug_msg_type; -void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); +void __custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); + +#ifdef DISABLE_LOG + +#define __MSG_FATAL(level, szCat, ...) +#define __MSG_ERROR(level, szCat, ...) +#define __MSG_WARN(level, szCat, ...) +#define __MSG_HIGH(level, szCat, ...) +#define __MSG_MED(level, szCat, ...) +#define __MSG_LOW(level, szCat, ...) +#define __MSG_DEBUG(level, szCat, ...) + +#else // DISABLE_LOG /* coverity[+kill] */ #define __MSG_FATAL(level, szCat, ...) \ @@ -136,7 +149,7 @@ void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); DBG_MSG_FATAL, \ "FATAL", \ }; \ - _custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ } \ } while(0) @@ -151,7 +164,7 @@ void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); DBG_MSG_ERROR, \ "ERROR", \ }; \ - _custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ } \ } while(0) @@ -167,7 +180,7 @@ void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); DBG_MSG_WARN, \ "WARN", \ }; \ - _custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ } \ } while(0) @@ -182,7 +195,7 @@ void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); DBG_MSG_HIGH, \ "HIGH", \ }; \ - _custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ } \ } while(0) @@ -197,7 +210,7 @@ void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); DBG_MSG_MED, \ "MED", \ }; \ - _custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ } \ } while(0) @@ -213,10 +226,27 @@ void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); DBG_MSG_LOW, \ "LOW", \ }; \ - _custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ } \ } while(0) +#define __MSG_DBG(level, szCat, ...) \ + do { \ + if ((level) & DBG_MSG_BIT_CUST13) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + DBG_MSG_BIT_CUST13, \ + "DBG", \ + }; \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + + +#endif // DISABLE_LOG #define ASSERT(level, szCat, expr) \ do { \ |