#undef LOG // Disable internal WebKit log to use LOG in dlog.h
#include <dlog/dlog.h>
#define DLOG_WEBKIT_TAG "WEBKIT"
+#define DLOG_CONSOLE_MESSAGE_TAG "ConsoleMessage"
#define DLOG_MAX_LENGTH 1024
#endif
va_end(args);
}
+
+#if ENABLE(TIZEN_DISPLAY_MESSAGE_TO_CONSOLE) // Request for WAC SDK
+void TizenConsoleMessage(TizenDlogPriority priority, const char* format, ...)
+{
+ va_list args;
+ va_start(args, format);
+
+ switch (priority) {
+ case TIZEN_DLOG_PRIORITY_INFO:
+ ALOG_VA(LOG_INFO, DLOG_CONSOLE_MESSAGE_TAG, format, args);
+ break;
+ case TIZEN_DLOG_PRIORITY_ERROR:
+ ALOG_VA(LOG_ERROR, DLOG_CONSOLE_MESSAGE_TAG, format, args);
+ break;
+ case TIZEN_DLOG_PRIORITY_WARN:
+ ALOG_VA(LOG_WARN, DLOG_CONSOLE_MESSAGE_TAG, format, args);
+ break;
+ case TIZEN_DLOG_PRIORITY_DEBUG:
+ ALOG_VA(LOG_DEBUG, DLOG_CONSOLE_MESSAGE_TAG, format, args);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ va_end(args);
+}
+#endif
#endif
} // extern "C"
#if ENABLE(TIZEN_DLOG_SUPPORT)
typedef enum {
TIZEN_DLOG_PRIORITY_ERROR,
- TIZEN_DLOG_PRIORITY_INFO
+ TIZEN_DLOG_PRIORITY_INFO,
+ TIZEN_DLOG_PRIORITY_WARN,
+ TIZEN_DLOG_PRIORITY_DEBUG
} TizenDlogPriority;
WTF_EXPORT_PRIVATE void TizenLog(TizenDlogPriority priority, bool secureLog, int line, const char* function, const char* format, ...);
+WTF_EXPORT_PRIVATE void TizenConsoleMessage(TizenDlogPriority priority, const char* format, ...);
#endif
#ifdef __cplusplus
#define TIZEN_SECURE_LOGE(...) TizenLog(TIZEN_DLOG_PRIORITY_ERROR, true, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__);
#define TIZEN_SECURE_LOGI(...) TizenLog(TIZEN_DLOG_PRIORITY_INFO, true, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__);
+// Use below macros to print out ConsoleMessage.
+#define TIZEN_CONSOLEE(...) TizenConsoleMessage(TIZEN_DLOG_PRIORITY_ERROR, __VA_ARGS__);
+#define TIZEN_CONSOLEI(...) TizenConsoleMessage(TIZEN_DLOG_PRIORITY_INFO, __VA_ARGS__);
+#define TIZEN_CONSOLEW(...) TizenConsoleMessage(TIZEN_DLOG_PRIORITY_WARN, __VA_ARGS__);
+#define TIZEN_CONSOLED(...) TizenConsoleMessage(TIZEN_DLOG_PRIORITY_DEBUG, __VA_ARGS__);
+
#define LOG(channel, ...) LOG_VERBOSE(channel, __VA_ARGS__)
#else
#define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__)
#include <WebCore/SecurityOrigin.h>
#include <WebCore/Settings.h>
-#if ENABLE(TIZEN_DISPLAY_MESSAGE_TO_CONSOLE)
-#include <dlog/dlog.h>
-#endif
-
using namespace WebCore;
using namespace HTMLNames;
switch (level) {
case WarningMessageLevel:
- ALOG(LOG_WARN, "ConsoleMessage", "%s", newMessage.utf8().data());
+ TIZEN_CONSOLEW("%s", newMessage.utf8().data());
break;
case ErrorMessageLevel:
- ALOG(LOG_ERROR, "ConsoleMessage", "%s", newMessage.utf8().data());
+ TIZEN_CONSOLEE("%s", newMessage.utf8().data());
break;
case LogMessageLevel:
- ALOG(LOG_DEBUG, "ConsoleMessage", "%s", newMessage.utf8().data());
+ TIZEN_CONSOLED("%s", newMessage.utf8().data());
break;
default:
- ALOG(LOG_INFO, "ConsoleMessage", "%s", newMessage.utf8().data());
+ TIZEN_CONSOLEI("%s", newMessage.utf8().data());
break;
}
#endif