diff options
author | Dmitry Volyntsev <xeioex@nginx.com> | 2023-09-08 17:13:19 -0700 |
---|---|---|
committer | Dmitry Volyntsev <xeioex@nginx.com> | 2023-09-08 17:13:19 -0700 |
commit | 036c785984d12745f468bc307d374446b4cb6415 (patch) | |
tree | 0662f5a7918d414309ca8e5d65af0b9c60a7fd36 /nginx/ngx_http_js_module.c | |
parent | b7dbeb95440e6828a9acac5ec96a1ceb684af575 (diff) | |
download | njs-036c785984d12745f468bc307d374446b4cb6415.tar.gz njs-036c785984d12745f468bc307d374446b4cb6415.zip |
Modules: improved debug log.
1) Ensuring that consistent prefixes are used:
"http js" in HTTP module and "stream js" in Stream module.
2) Added debug for every event/callback handler entrance.
3) Added debug with a method name for every JS call.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r-- | nginx/ngx_http_js_module.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index 2574a3be..f8811617 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -1075,6 +1075,9 @@ ngx_http_js_header_filter(ngx_http_request_t *r) return ngx_http_next_header_filter(r); } + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http js header filter"); + rc = ngx_http_js_init_vm(r, ngx_http_js_request_proto_id); if (rc == NGX_ERROR || rc == NGX_DECLINED) { @@ -1086,6 +1089,9 @@ ngx_http_js_header_filter(ngx_http_request_t *r) ctx->filter = 1; pending = njs_vm_pending(ctx->vm); + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http js header call \"%V\"", &jlcf->header_filter); + rc = ngx_js_call(ctx->vm, &jlcf->header_filter, r->connection->log, &ctx->request, 1); @@ -1127,6 +1133,9 @@ ngx_http_js_body_filter(ngx_http_request_t *r, ngx_chain_t *in) return ngx_http_next_body_filter(r, in); } + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http js body filter"); + rc = ngx_http_js_init_vm(r, ngx_http_js_request_proto_id); if (rc == NGX_ERROR || rc == NGX_DECLINED) { @@ -1183,6 +1192,9 @@ ngx_http_js_body_filter(ngx_http_request_t *r, ngx_chain_t *in) pending = njs_vm_pending(ctx->vm); + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, + "http js body call \"%V\"", &jlcf->body_filter); + rc = ngx_js_call(ctx->vm, &jlcf->body_filter, c->log, &arguments[0], 3); |