summaryrefslogtreecommitdiff
path: root/script-beta/pub/report.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/pub/report.lua')
-rw-r--r--script-beta/pub/report.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/script-beta/pub/report.lua b/script-beta/pub/report.lua
new file mode 100644
index 00000000..edd3ee0e
--- /dev/null
+++ b/script-beta/pub/report.lua
@@ -0,0 +1,21 @@
+local pub = require 'pub.pub'
+local await = require 'await'
+
+pub.on('log', function (params, brave)
+ log.raw(brave.id, params.level, params.msg, params.src, params.line)
+end)
+
+pub.on('mem', function (count, brave)
+ brave.memory = count
+end)
+
+pub.on('proto', function (params)
+ local proto = require 'proto'
+ await.create(function ()
+ if params.method then
+ proto.doMethod(params)
+ else
+ proto.doResponse(params)
+ end
+ end)
+end)