From b3bb80a4805e38aef99784026c1e4d053a757f5f Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Thu, 25 Aug 2016 22:02:57 +0200 Subject: [PATCH] Allow custom log function. Not only console --- lib/core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core.js b/lib/core.js index 9d45511..3fe2133 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1,6 +1,6 @@ 'use strict'; -function log(debug) { +function _log(debug) { if (debug) { var args = Array.prototype.slice.call(arguments); args.shift(); @@ -13,6 +13,7 @@ module.exports.create = function (le) { var PromiseA = require('bluebird'); var utils = require('./utils'); var RSA = PromiseA.promisifyAll(require('rsa-compat').RSA); + var log = le.log || _log; // allow custom log var core = { //