Sync Logger API
Summary: - Sync Logger API with C implementation Reviewed By: emilsjolander Differential Revision: D4143019 fbshipit-source-id: f20203320bad5b8f4b9cce01a5b2e7c615a4d923
This commit is contained in:
committed by
Facebook Github Bot
parent
f1fcd5e382
commit
863378d74e
@@ -11,15 +11,12 @@
|
||||
|
||||
static CSSInteropLoggerFunc gManagedFunc;
|
||||
|
||||
static int unmanagedLogger(const char *format, ...) {
|
||||
static int unmanagedLogger(CSSLogLevel level, const char *format, va_list args) {
|
||||
int result = 0;
|
||||
if (gManagedFunc) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
char buffer[256];
|
||||
result = vsnprintf(buffer, sizeof(buffer), format, args);
|
||||
(*gManagedFunc)(buffer);
|
||||
va_end(args);
|
||||
(*gManagedFunc)(level, buffer);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
CSS_EXTERN_C_BEGIN
|
||||
|
||||
typedef void (*CSSInteropLoggerFunc)(const char *message);
|
||||
typedef void (*CSSInteropLoggerFunc)(CSSLogLevel level, const char *message);
|
||||
|
||||
WIN_EXPORT void CSSInteropSetLogger(CSSInteropLoggerFunc managedFunc);
|
||||
|
||||
|
Reference in New Issue
Block a user