Add the user-visible logging interface.
Details:
- Add the logging level type WGPULoggingType, including levels verbose,
info, warning, and error,
- Add the API SetLoggingCallback, which bind the callback to deal with
logging string,
- Add the return command DeviceLoggingCallback and related code,
- Add DeviceBase::EmitLog(WGPULoggingType, const char*) , and
DeviceBase::EmitLog(const char*) use WGPULoggingType_info as default,
to post logging from native or server device to bound callback
via CallbackTaskManager.
BUG: dawn:792
Change-Id: I107b9134ff8567a46fa452509799e10b6862b8d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52200
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
diff --git a/dawn.json b/dawn.json
index 7029aad..be6bf53 100644
--- a/dawn.json
+++ b/dawn.json
@@ -824,6 +824,13 @@
]
},
{
+ "name": "set logging callback",
+ "args": [
+ {"name": "callback", "type": "logging callback"},
+ {"name": "userdata", "type": "void", "annotation": "*"}
+ ]
+ },
+ {
"name": "set device lost callback",
"args": [
{"name": "callback", "type": "device lost callback"},
@@ -876,6 +883,14 @@
{"name": "userdata", "type": "void", "annotation": "*"}
]
},
+ "logging callback": {
+ "category": "callback",
+ "args": [
+ {"name": "type", "type": "logging type"},
+ {"name": "message", "type": "char", "annotation": "const*"},
+ {"name": "userdata", "type": "void", "annotation": "*"}
+ ]
+ },
"error filter": {
"category": "enum",
"values": [
@@ -894,6 +909,15 @@
{"value": 4, "name": "device lost"}
]
},
+ "logging type": {
+ "category": "enum",
+ "values": [
+ {"value": 0, "name": "verbose"},
+ {"value": 1, "name": "info"},
+ {"value": 2, "name": "warning"},
+ {"value": 3, "name": "error"}
+ ]
+ },
"extent 3D": {
"category": "structure",
"members": [