From 08fca8de771b8ae531dba7e8985d6aa73de127a7 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Tue, 2 Jan 2024 11:33:36 +0000 Subject: [PATCH] Added console.debug/info/warn/error as aliases of console.log --- ChangeLog | 1 + src/jswrap_functions.c | 44 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/ChangeLog b/ChangeLog index f2a407a57d..63c2c2387d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,7 @@ Microbit2: Set up SCK/LRCK to unused pins for neopixel to ensure neopixel will work ok ESP8266/others: Fix ArrayBuffers with 12 bit JsVars (previously they overflowed) Ensure E.setDST disables E.setTimeZone, and vice-versa. + Added console.debug/info/warn/error as aliases of console.log 2v19 : Fix Object.values/entries for numeric keys after 2v18 regression (fix #2375) nRF52: for SD>5 use static buffers for advertising and scan response data (#2367) diff --git a/src/jswrap_functions.c b/src/jswrap_functions.c index 7cdd438dc3..dca05247cb 100644 --- a/src/jswrap_functions.c +++ b/src/jswrap_functions.c @@ -591,3 +591,47 @@ void jswrap_print(JsVar *v) { } +/*JSON{ + "type" : "staticmethod", + "class" : "console", + "name" : "debug", + "generate" : "jswrap_print", + "params" : [ + ["text","JsVarArray","One or more arguments to print"] + ] +} +Implemented in Espruino as an alias of `console.log` + */ +/*JSON{ + "type" : "staticmethod", + "class" : "console", + "name" : "info", + "generate" : "jswrap_print", + "params" : [ + ["text","JsVarArray","One or more arguments to print"] + ] +} +Implemented in Espruino as an alias of `console.log` + */ +/*JSON{ + "type" : "staticmethod", + "class" : "console", + "name" : "warn", + "generate" : "jswrap_print", + "params" : [ + ["text","JsVarArray","One or more arguments to print"] + ] +} +Implemented in Espruino as an alias of `console.log` + */ +/*JSON{ + "type" : "staticmethod", + "class" : "console", + "name" : "error", + "generate" : "jswrap_print", + "params" : [ + ["text","JsVarArray","One or more arguments to print"] + ] +} +Implemented in Espruino as an alias of `console.log` + */ \ No newline at end of file