+ const char *oom = "Out of memory";
+ char timestr[128];
+ int len = 0;
+ char *str;
+
+ if (weston_log_scope_is_enabled(log_scope)) {
+ int len_va;
+ char *xlog_timestamp = log_timestamp(timestr, sizeof(timestr));
+ len_va = vasprintf(&str, fmt, ap);
+ if (len_va >= 0) {
+ len = weston_log_scope_printf(log_scope, "%s %s",
+ xlog_timestamp, str);
+ free(str);
+ } else {
+ len = weston_log_scope_printf(log_scope, "%s %s",
+ xlog_timestamp, oom);
+ }
+ }