aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioex@nginx.com>2023-12-14 22:32:02 -0800
committerDmitry Volyntsev <xeioex@nginx.com>2023-12-14 22:32:02 -0800
commit76552eab1cdb65dd4624a6abe1b943fd27e9b87a (patch)
tree2477986543a71054ab84fc72abbfc9adcb97f29b /nginx/ngx_http_js_module.c
parent2208f08f1988d73b2d525158a6dda13d380e76ca (diff)
downloadnjs-76552eab1cdb65dd4624a6abe1b943fd27e9b87a.tar.gz
njs-76552eab1cdb65dd4624a6abe1b943fd27e9b87a.zip
Moving out logger from njs core.
Logger is not part of the JS runtime according to ECMAScript and should be implemented by host environment.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r--nginx/ngx_http_js_module.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 56de05a0..8ed5972e 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -839,11 +839,6 @@ static njs_external_t ngx_http_js_ext_periodic_session[] = {
};
-static njs_vm_ops_t ngx_http_js_ops = {
- ngx_js_logger,
-};
-
-
static uintptr_t ngx_http_js_uptr[] = {
offsetof(ngx_http_request_t, connection),
(uintptr_t) ngx_http_js_pool,
@@ -1660,8 +1655,9 @@ ngx_http_js_ext_header_out(njs_vm_t *vm, njs_object_prop_t *prop,
}
if (r->header_sent && setval != NULL) {
- njs_vm_warn(vm, "ignored setting of response header \"%V\" because"
- " headers were already sent", &name);
+ ngx_log_error(NGX_LOG_WARN, r->connection->log, 0,
+ "ignored setting of response header \"%V\" because"
+ " headers were already sent", &name);
}
for (h = headers_out; h->name.length > 0; h++) {
@@ -4509,7 +4505,6 @@ ngx_http_js_init_conf_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf)
options.backtrace = 1;
options.unhandled_rejection = NJS_VM_OPT_UNHANDLED_REJECTION_THROW;
- options.ops = &ngx_http_js_ops;
options.metas = &ngx_http_js_metas;
options.addons = njs_http_js_addon_modules;
options.argv = ngx_argv;