Home

Awesome

level-log

Log all leveldb operations.

build status

Example

var level = require('level');
var log = require('level-log');

var db = level('db');
var events = log(db);

events.on('op', function(name, args, stream){
  console.log(name, args, !!stream);
  // => "put" ["foo", "bar", function()] false
  // => "get" ["foo", function()] false
  // => "createReadStream" [] true
});

events.on('createReadStream', function(args, stream){
  // ...
});

db.put('foo', 'bar', function(){
  db.get('foo', function(){});
});

db.createReadStream();

Installation

$ npm install level-log

API

var events = log(db[, opts])

Start tracking db. Options:

events.on('op', fn)

On every operation, call fn with

events.on(method, fn)

On every call to method, call fn with

License

MIT