Replace all printfs with tf_printf, which redirects to android logging. Change into the files directory so that sqlite can do its thing. Getting closer.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4203 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "util.js.h"
|
||||
|
||||
#include "log.h"
|
||||
#include "mem.h"
|
||||
#include "task.h"
|
||||
#include "trace.h"
|
||||
@ -136,23 +137,23 @@ JSValue _util_print(JSContext* context, JSValueConst this_val, int argc, JSValue
|
||||
tf_task_t* task = JS_GetContextOpaque(context);
|
||||
if (task)
|
||||
{
|
||||
printf("Task[%p:%s]>", task, tf_task_get_name(task));
|
||||
tf_printf("Task[%p:%s]>", task, tf_task_get_name(task));
|
||||
tf_task_print(task, argc, argv);
|
||||
}
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
if (JS_IsNull(argv[i]))
|
||||
{
|
||||
printf(" null");
|
||||
tf_printf(" null");
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* value = JS_ToCString(context, argv[i]);
|
||||
printf(" %s", value);
|
||||
tf_printf(" %s", value);
|
||||
JS_FreeCString(context, value);
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
tf_printf("\n");
|
||||
return JS_NULL;
|
||||
}
|
||||
|
||||
@ -162,14 +163,14 @@ bool tf_util_report_error(JSContext* context, JSValue value)
|
||||
if (JS_IsError(context, value))
|
||||
{
|
||||
const char* string = JS_ToCString(context, value);
|
||||
printf("ERROR: %s\n", string);
|
||||
tf_printf("ERROR: %s\n", string);
|
||||
JS_FreeCString(context, string);
|
||||
|
||||
JSValue stack = JS_GetPropertyStr(context, value, "stack");
|
||||
if (!JS_IsUndefined(stack))
|
||||
{
|
||||
const char* stack_str = JS_ToCString(context, stack);
|
||||
printf("%s\n", stack_str);
|
||||
tf_printf("%s\n", stack_str);
|
||||
JS_FreeCString(context, stack_str);
|
||||
}
|
||||
JS_FreeValue(context, stack);
|
||||
|
Reference in New Issue
Block a user