# HG changeset patch # User Yaroslav Zhuravlev # Date 1696321889 -3600 # Node ID 3a85326ed38cfad60a859f35d37fab9dd05a61d5 # Parent c0a4a4a55e450882e5573e1d950b0505960b196c Documented Console object in njs Reference. diff --git a/xml/en/docs/njs/changes.xml b/xml/en/docs/njs/changes.xml --- a/xml/en/docs/njs/changes.xml +++ b/xml/en/docs/njs/changes.xml @@ -9,7 +9,7 @@
@@ -5087,8 +5087,10 @@ making global object mutable. Feature: -console.time() and -console.timeEnd() methods. +console.time() +and +console.timeEnd() +methods. diff --git a/xml/en/docs/njs/compatibility.xml b/xml/en/docs/njs/compatibility.xml --- a/xml/en/docs/njs/compatibility.xml +++ b/xml/en/docs/njs/compatibility.xml @@ -9,7 +9,7 @@
@@ -981,6 +981,17 @@ Global objects +console +(0.8.2): +error, +info, +log, +time, +timeEnd, +warn + + + crypto (0.7.0): getRandomValues, diff --git a/xml/en/docs/njs/reference.xml b/xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml +++ b/xml/en/docs/njs/reference.xml @@ -9,7 +9,7 @@
+ rev="118">
@@ -1840,6 +1840,72 @@ or
+
+ + + + + + + + + +
console.error()
console.info()
console.log()
console.time()
console.timeEnd()
console.warn()
+
+ + +The console object is available +in nginx since 0.8.2, +in CLI since 0.2.6. + + +console.error(msg[, msg2 ...]) + +Outputs one or more error messages. +The message may be a string or an object. + + +console.info(msg[, msg2 ...]) + +Outputs one or more info messages. +The message may be a string or an object. + + +console.log(msg[, msg2 ...]) + +Outputs one or more log messages. +The message may be a string or an object. + + +console.time(label) + +Starts a timer that can track how long an operation takes. +The label parameter allows naming different timers. +If console.timeEnd() +with the same name is called, +the time that elapsed since the timer was started will be output, +in milliseconds. + + +console.timeEnd(label) + +Stops a timer previously started by +console.time() +The label parameter allows naming different timers. + + +console.warn(msg[, msg2 ...]) + +Outputs one or more warning messages. +The message may be a string or an object. + + + + + +
+ +
diff --git a/xml/ru/docs/njs/compatibility.xml b/xml/ru/docs/njs/compatibility.xml --- a/xml/ru/docs/njs/compatibility.xml +++ b/xml/ru/docs/njs/compatibility.xml @@ -9,7 +9,7 @@
@@ -981,6 +981,17 @@ ES6 поддержка стрелочных функций +console +(0.8.2): +error, +info, +log, +time, +timeEnd, +warn + + + crypto (0.7.0): getRandomValues,