Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added custom logging function option

  • Loading branch information...
commit 0c0a0326d7c14b9f8bd2534c2167c522b151a0fc 1 parent b41e3fd
@odbol odbol authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/connect-memcached.js
View
6 lib/connect-memcached.js
@@ -50,6 +50,8 @@ module.exports = function(connect){
*/
function MemcachedStore(options) {
+ var log = options.loggingFunction || console.log;
+
options = options || {};
Store.call(this, options);
if (!options.hosts) {
@@ -61,10 +63,10 @@ module.exports = function(connect){
}
this.client = new Memcached(options.hosts, options);
- console.log("MemcachedStore initialized for servers: " + options.hosts);
+ log("MemcachedStore initialized for servers: " + options.hosts);
this.client.on("issue", function(issue) {
- console.log("MemcachedStore::Issue @ " + issue.server + ": " +
+ log("MemcachedStore::Issue @ " + issue.server + ": " +
issue.messages + ", " + issue.retries + " attempts left");
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.