Skip to content
This repository has been archived by the owner on Mar 5, 2018. It is now read-only.

Added lazy for request log methods #5

Closed
wants to merge 3 commits into from

Conversation

dschenkelman
Copy link
Contributor

Profiling a node.js app an generating a flame chart for it indicates that some time is spent on the bind call that is changed by this PR.

Since most requests won't actually need all log leves, lazy execution of the bind improves this.

@@ -31,7 +31,7 @@ function logEvent(ctx, data, request) {
} else if (ctx.includeData && data.data !== undefined) {
if (ctx.mergeData) {
try {
lodash.assign(obj, data.data);
obj = lodash.assign(data.data, obj);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't modify data people send into a logging library, it's going to screw up other plugins.

@silas silas closed this in dfaf108 Feb 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants