mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-07 19:13:20 +00:00
1. Added console.log/info helper
2. Fixed bug with user-sessions adding virtual uids incorrectly
This commit is contained in:
@@ -1202,7 +1202,21 @@ void Duktape_Console_Log(duk_context *ctx, void *chain, ILibDuktape_LogTypes log
|
||||
ILibChain_RunOnMicrostackThreadEx(chain, Duktape_Console_Log_Chain, data);
|
||||
}
|
||||
}
|
||||
void Duktape_Console_LogEx(duk_context *ctx, ILibDuktape_LogTypes logType, char *format, ...)
|
||||
{
|
||||
char dest[4096];
|
||||
int len = 0;
|
||||
va_list argptr;
|
||||
|
||||
if (ctx != NULL && format != NULL)
|
||||
{
|
||||
va_start(argptr, format);
|
||||
len += vsnprintf(dest + len, sizeof(dest) - len, format, argptr);
|
||||
va_end(argptr);
|
||||
}
|
||||
|
||||
Duktape_Console_Log(ctx, duk_ctx_chain(ctx), logType, dest, (duk_size_t)len);
|
||||
}
|
||||
char* ILibDuktape_String_AsWide(duk_context *ctx, duk_idx_t idx, duk_size_t *len)
|
||||
{
|
||||
char *src;
|
||||
|
||||
@@ -173,6 +173,7 @@ void duk_buffer_enable_autoclear(duk_context *ctx);
|
||||
void* Duktape_DynamicBuffer_Resize(duk_context *ctx, duk_idx_t idx, duk_size_t bufSize);
|
||||
|
||||
void Duktape_Console_Log(duk_context *ctx, void *chain, ILibDuktape_LogTypes logType, char *msg, duk_size_t msgLen);
|
||||
void Duktape_Console_LogEx(duk_context *ctx, ILibDuktape_LogTypes logType, char *format, ...);
|
||||
|
||||
typedef void(*ILibDuktape_NativeUncaughtExceptionHandler)(duk_context *ctx, char *msg, void *user);
|
||||
void ILibDuktape_SetNativeUncaughtExceptionHandler(duk_context *ctx, ILibDuktape_NativeUncaughtExceptionHandler handler, void *user);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user