release tizen_2.0 beta
[framework/telephony/tel-plugin-socket_communicator.git] / common / include / sipc_log.h
index aac69ef..ee341a6 100644 (file)
  * limitations under the License.
  */
 
-#ifndef __TPAPI_LOG_H__
-#define __TPAPI_LOG_H__
+#ifndef __TAPI_LOG_H__
+#define __TAPI_LOG_H__
+
+#include <dlog.h>
 
 __BEGIN_DECLS
 
-#define ANSI_COLOR_NORMAL "\e[0m"
-
-#define ANSI_COLOR_BLACK "\e[0;30m"
-#define ANSI_COLOR_RED "\e[0;31m"
-#define ANSI_COLOR_GREEN "\e[0;32m"
-#define ANSI_COLOR_BROWN "\e[0;33m"
-#define ANSI_COLOR_BLUE "\e[0;34m"
-#define ANSI_COLOR_MAGENTA "\e[0;35m"
-#define ANSI_COLOR_CYAN "\e[0;36m"
-#define ANSI_COLOR_LIGHTGRAY "\e[0;37m"
-
-#define ANSI_COLOR_DARKGRAY "\e[1;30m"
-#define ANSI_COLOR_LIGHTRED "\e[1;31m"
-#define ANSI_COLOR_LIGHTGREEN "\e[1;32m"
-#define ANSI_COLOR_YELLOW "\e[1;33m"
-#define ANSI_COLOR_LIGHTBLUE "\e[1;34m"
-#define ANSI_COLOR_LIGHTMAGENTA "\e[1;35m"
-#define ANSI_COLOR_LIGHTCYAN "\e[1;36m"
-#define ANSI_COLOR_WHITE "\e[1;37m"
-
-#ifndef TELEPHONY_LOG_FILE
-#define TELEPHONY_LOG_FILE stdout
+#ifndef dbg
+
+#ifndef TAPI_LOG_TAG
+#define TAPI_LOG_TAG "TAPI"
 #endif
-#if 0
-#define msg(fmt,args...)  { fprintf(TELEPHONY_LOG_FILE, fmt "\n", ##args); fflush(TELEPHONY_LOG_FILE); }
-#define dbg(fmt,args...)  { fprintf(TELEPHONY_LOG_FILE, ANSI_COLOR_LIGHTGRAY "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TELEPHONY_LOG_FILE); }
-#define warn(fmt,args...) { fprintf(TELEPHONY_LOG_FILE, ANSI_COLOR_YELLOW "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TELEPHONY_LOG_FILE); }
-#define err(fmt,args...)  { fprintf(TELEPHONY_LOG_FILE, ANSI_COLOR_LIGHTRED "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TELEPHONY_LOG_FILE); }
+
+#define msg(fmt,args...)  { RLOG(LOG_INFO, TAPI_LOG_TAG, fmt "\n", ##args); }
+#define dbg(fmt,args...)  { RLOG(LOG_DEBUG, TAPI_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); }
+#define warn(fmt,args...)  { RLOG(LOG_WARN, TAPI_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); }
+#define err(fmt,args...)  { RLOG(LOG_FATAL, TAPI_LOG_TAG, "<%s:%D> " fmt "\n", __func__, __LINE__, ##args); }
+
 #endif
 
 __END_DECLS