Skip to content
Browse files

Fill in unspecified default options

If a user passes in a half-filled options (i.e. they want to change the
log directory, and template, but use the default fields), then make that
work.
  • Loading branch information...
1 parent 41ae68e commit d58ca01d12b6d6c784f39c7966ced04435d8ead8 @mhansen mhansen committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/elf-logger.js
View
4 lib/elf-logger.js
@@ -17,7 +17,9 @@ exports.defaultOptions = {
// 'createLogger' is the function to call to have elf-logger start
// monitoring requests and responses on a Node HTTP server instance
exports.createLogger = function(httpServer, options) {
- return new ElfLogger(httpServer, options || exports.defaultOptions);
+ options = options || {};
+ options.__proto__ = exports.defaultOptions;
+ return new ElfLogger(httpServer, options);
};

0 comments on commit d58ca01

Please sign in to comment.
Something went wrong with that request. Please try again.