projects
/
squeep-api-dingus
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aee1a77
)
log raw handler objects, rather than deprecated wrapper
author
Justin Wind
<justin.wind+git@gmail.com>
Wed, 27 Apr 2022 22:16:50 +0000
(15:16 -0700)
committer
Justin Wind
<justin.wind+git@gmail.com>
Wed, 27 Apr 2022 22:16:50 +0000
(15:16 -0700)
lib/dingus.js
patch
|
blob
|
history
diff --git
a/lib/dingus.js
b/lib/dingus.js
index 51da6fab6b2185680cace1f8d1ad48921283d59d..4eded66a727e1d831e7249b462abb3d5da50fa17 100644
(file)
--- a/
lib/dingus.js
+++ b/
lib/dingus.js
@@
-521,7
+521,7
@@
class Dingus {
*/
async serveFile(req, res, ctx, directory, fileName) {
const _scope = _fileScope('serveFile');
*/
async serveFile(req, res, ctx, directory, fileName) {
const _scope = _fileScope('serveFile');
- this.logger.debug(_scope, 'called', { req
: common.requestLogData(req)
, ctx });
+ this.logger.debug(_scope, 'called', { req, ctx });
// Require a directory field.
if (!directory) {
// Require a directory field.
if (!directory) {
@@
-649,11
+649,11
@@
class Dingus {
if (err && err.statusCode) {
res.statusCode = err.statusCode;
body = this.renderError(res.getHeader(Enum.Header.ContentType), err);
if (err && err.statusCode) {
res.statusCode = err.statusCode;
body = this.renderError(res.getHeader(Enum.Header.ContentType), err);
- this.logger.debug(_scope, 'handler error', { err,
...common.handlerLogData(req, res, ctx)
});
+ this.logger.debug(_scope, 'handler error', { err,
req, res, ctx
});
} else {
res.statusCode = 500;
body = this.renderError(res.getHeader(Enum.Header.ContentType), Enum.ErrorResponse.InternalServerError);
} else {
res.statusCode = 500;
body = this.renderError(res.getHeader(Enum.Header.ContentType), Enum.ErrorResponse.InternalServerError);
- this.logger.error(_scope, 'handler exception', { err,
...common.handlerLogData(req, res, ctx)
});
+ this.logger.error(_scope, 'handler exception', { err,
req, res, ctx
});
}
res.end(body);
}
}
res.end(body);
}