couchdb-audit/kanso.js
function(db, auditDb) {
    var dbWrapper = getDbWrapper(db);
    var auditDbWrapper;
    if (auditDb) {
      auditDbWrapper = getDbWrapper(auditDb);
    } else {
      auditDbWrapper = dbWrapper;
    }

    var clientWrapper = {
      uuids: function(count, callback) {
        db.newUUID.call(db, 100, function(err, id) {
          callback(err, {uuids: [id]});
        });
      }
    };

    return log.init(appname, clientWrapper, dbWrapper, auditDbWrapper, function(callback) {
      session.info(function(err, result) {
        if (err) {
          return callback(err);
        }
        callback(null, result.userCtx.name);
      });
    });
  }
function(db, auditDb) {
    var dbWrapper = getDbWrapper(db);
    var auditDbWrapper;
    if (auditDb) {
      auditDbWrapper = getDbWrapper(auditDb);
    } else {
      auditDbWrapper = dbWrapper;
    }

    var clientWrapper = {
      uuids: function(count, callback) {
        db.newUUID.call(db, 100, function(err, id) {
          callback(err, {uuids: [id]});
        });
      }
    };

    return log.init(appname, clientWrapper, dbWrapper, auditDbWrapper, function(callback) {
      session.info(function(err, result) {
        if (err) {
          return callback(err);
        }
        callback(null, result.userCtx.name);
      });
    });
  }
function ( db , auditDb ) { var dbWrapper = getDbWrapper ( db ) ; var auditDbWrapper ; if ( auditDb ) { auditDbWrapper = getDbWrapper ( auditDb ) ; } else { auditDbWrapper = dbWrapper ; } var clientWrapper = { uuids : function ( count , callback ) { db . newUUID . call ( db , 100 , function ( err , id ) { callback ( err , { uuids : [ id ] } ) ; } ) ; } } ; return log . init ( appname , clientWrapper , dbWrapper , auditDbWrapper , function ( callback ) { session . info ( function ( err , result ) { if ( err ) { return callback ( err ) ; } callback ( null , result . userCtx . name ) ; } ) ; } ) ; }
Sets up auditing to work with the kanso db module.

@name withKanso(db)
@param {Object} db The kanso db instance to use.
@param {Object} auditDb Optionally the kanso db instance to use for auditing.
@api public
Sets up auditing to work with the kanso db module .