Git init
[framework/system/sys-assert.git] / lockupinfo / _util_log.h
1
2 /*
3  *  LOCKUPINFO
4  *
5  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6  *
7  * Contact: Jeesun Kim <iamjs.kim@samsung.com>
8  * 
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 #ifndef __LOCKUPINFO_UTIL_LOG_H__
24 #define __LOCKUPINFO_UTIL_LOG_H__
25
26 #include <unistd.h>
27 //#include <dlog.h>
28
29 #undef LOG_TAG
30 #define LOG_TAG "LOCKUPINFO"
31 #define _E(fmt, arg...) fprintf(stderr, "[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
32 #define _D(fmt, arg...) fprintf(stderr, "[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
33 //#define _E(fmt, arg...) LOGE("[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
34 //#define _D(fmt, arg...) LOGD("[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
35
36 #define retvm_if(expr, val, fmt, arg...) do { \
37         if(expr) { \
38                 _E(fmt, ##arg); \
39                 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
40                 return (val); \
41         } \
42 } while (0)
43
44 #define retv_if(expr, val) do { \
45         if(expr) { \
46                 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
47                 return (val); \
48         } \
49 } while (0)
50
51 #define retm_if(expr, fmt, arg...) do { \
52         if(expr) { \
53                 _E(fmt, ##arg); \
54                 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
55                 return; \
56         } \
57 } while (0)
58
59 #define ret_if(expr) do { \
60         if(expr) { \
61                 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
62                 return; \
63         } \
64 } while (0)
65
66
67 #endif                          /* __LOCKUPINFO_UTIL_LOG_H__ */