Update logging to support levels, print messages in Android logcat on assertion failures

Summary:
@public

The goal of this diff is to have assertion failures show up as error logs on Android. To do this, I updated the logging API to take calls with log levels. We now have to pass around va_list unfortunately since you can't re-expand or pass along var-args to a subcall.

Reviewed By: emilsjolander

Differential Revision: D4140898

fbshipit-source-id: e0eb9a1f0b08a7d90a8233f66bb857d5b871b6ad
This commit is contained in:
Andy Street
2016-11-09 09:45:37 -08:00
committed by Facebook Github Bot
parent 6a6efe0764
commit f1fcd5e382
3 changed files with 86 additions and 43 deletions

View File

@@ -36,7 +36,7 @@
#if CSS_ASSERT_FAIL_ENABLED
#define CSS_ERROR_FUNC(message) CSSAssertFail(message)
#else
#define CSS_ERROR_FUNC(message) fprintf(stderr, "%s", message)
#define CSS_ERROR_FUNC(message) CSSLog(CSSLogLevelError, "%s", message)
#endif
#ifndef CSS_ASSERT