#include <zircon/syscalls.h>
#endif
+#if defined(OS_TIZEN)
+#define LOG_TAG "CHROMIUM"
+#include <dlog/dlog.h>
+#endif
+
namespace logging {
namespace {
// A log message handler that gets notified of every log message we process.
LogMessageHandlerFunction log_message_handler = nullptr;
+#if !defined(OS_TIZEN)
// Helper functions to wrap platform differences.
int32_t CurrentProcessId() {
return absolute_micro;
#endif
}
+#endif
void DeleteFilePath(const PathString& log_name) {
#if defined(OS_WIN)
break;
}
__android_log_write(priority, "chromium", str_newline.c_str());
-#endif
+#elif defined(OS_TIZEN)
+ log_priority priority = DLOG_UNKNOWN;
+ switch (severity_) {
+ case LOG_INFO:
+ priority = DLOG_INFO;
+ break;
+ case LOG_WARNING:
+ priority = DLOG_WARN;
+ break;
+ case LOG_ERROR:
+ priority = DLOG_ERROR;
+ break;
+ case LOG_FATAL:
+ priority = DLOG_FATAL;
+ break;
+ }
+ dlog_print(priority, LOG_TAG, "%s", str_newline.c_str());
+#else
ignore_result(fwrite(str_newline.data(), str_newline.size(), 1, stderr));
fflush(stderr);
+#endif
} else if (severity_ >= kAlwaysPrintErrorLevel) {
// When we're only outputting to a log file, above a certain log level, we
// should still output to stderr so that we can better detect and diagnose
// problems with unit tests, especially on the buildbots.
+#if defined(OS_TIZEN)
+ log_priority priority = DLOG_UNKNOWN;
+ switch (severity_) {
+ case LOG_INFO:
+ priority = DLOG_INFO;
+ break;
+ case LOG_WARNING:
+ priority = DLOG_WARN;
+ break;
+ case LOG_ERROR:
+ priority = DLOG_ERROR;
+ break;
+ case LOG_FATAL:
+ priority = DLOG_FATAL;
+ break;
+ }
+ dlog_print(priority, LOG_TAG, "%s", str_newline.c_str());
+#else
ignore_result(fwrite(str_newline.data(), str_newline.size(), 1, stderr));
fflush(stderr);
+#endif
}
// write to log file
// TODO(darin): It might be nice if the columns were fixed width.
stream_ << '[';
+#if !defined(OS_TIZEN)
if (g_log_process_id)
stream_ << CurrentProcessId() << ':';
if (g_log_thread_id)
}
if (g_log_tickcount)
stream_ << TickCount() << ':';
+#endif
if (severity_ >= 0)
stream_ << log_severity_name(severity_);
else
#include <android/log.h> // NOLINT
#endif
+#if defined(OS_TIZEN)
+#define JS_LOG_TAG "V8"
+#include <dlog/dlog.h>
+#endif
+
#include <cmath>
#include <cstdlib>
void OS::VPrint(const char* format, va_list args) {
#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
__android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
+#elif defined(OS_TIZEN)
+ dlog_vprint(DLOG_INFO, JS_LOG_TAG, format, args);
#else
vprintf(format, args);
#endif
void OS::VFPrint(FILE* out, const char* format, va_list args) {
#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
__android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
+#elif defined(OS_TIZEN)
+ dlog_vprint(DLOG_INFO, JS_LOG_TAG, format, args);
#else
vfprintf(out, format, args);
#endif
void OS::VPrintError(const char* format, va_list args) {
#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
__android_log_vprint(ANDROID_LOG_ERROR, LOG_TAG, format, args);
+#elif defined(OS_TIZEN)
+ dlog_vprint(DLOG_ERROR, JS_LOG_TAG, format, args);
#else
vfprintf(stderr, format, args);
#endif