Tests: added njs extended logging tests.
diff --git a/js.t b/js.t index 27aea6e..1e444d2 100644 --- a/js.t +++ b/js.t
@@ -178,7 +178,9 @@ } function test_log(req, res) { - req.log("SEE-THIS"); + req.log("SEE-THIS-LOG"); + req.warn("SEE-THIS-WARN"); + req.error("SEE-THIS-ERROR"); } function test_except(req, res) { @@ -261,7 +263,7 @@ EOF -$t->try_run('no njs available')->plan(22); +$t->try_run('no njs available')->plan(24); ############################################################################### @@ -302,7 +304,9 @@ $t->stop(); -ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'log js'); +ok(index($t->read_file('error.log'), 'SEE-THIS-LOG') > 0, 'log js'); +ok(index($t->read_file('error.log'), 'SEE-THIS-WARN') > 0, 'warn js'); +ok(index($t->read_file('error.log'), 'SEE-THIS-ERROR') > 0, 'error js'); ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0, 'js_set backtrace'); ok(index($t->read_file('error.log'), 'at JSON.parse') > 0,
diff --git a/stream_js.t b/stream_js.t index 1005ada..e251368 100644 --- a/stream_js.t +++ b/stream_js.t
@@ -133,7 +133,9 @@ } function js_log(sess) { - sess.log("SEE-THIS"); + sess.log("SEE-THIS-LOG"); + sess.warn("SEE-THIS-WARN"); + sess.error("SEE-THIS-ERROR"); } function js_access_allow(sess) { @@ -199,7 +201,7 @@ EOF $t->run_daemon(\&stream_daemon, port(8090)); -$t->try_run('no stream njs available')->plan(14); +$t->try_run('no stream njs available')->plan(16); $t->waitforsocket('127.0.0.1:' . port(8090)); ############################################################################### @@ -223,7 +225,9 @@ $t->stop(); -ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'stream js log'); +ok(index($t->read_file('error.log'), 'SEE-THIS-LOG') > 0, 'stream js log'); +ok(index($t->read_file('error.log'), 'SEE-THIS-WARN') > 0, 'stream js warn'); +ok(index($t->read_file('error.log'), 'SEE-THIS-ERROR') > 0, 'stream js error'); ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0, 'stream js_preread backtrace'); ok(index($t->read_file('error.log'), 'at js_filter_except') > 0,