add debug log

This commit is contained in:
Feross Aboukhadijeh 2016-02-09 22:09:48 -08:00
parent 9bf62ed135
commit 0734f4b4e0
2 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
var bencode = require('bencode') var bencode = require('bencode')
var BitField = require('bitfield') var BitField = require('bitfield')
var debug = require('debug')('ut_metadata')
var EventEmitter = require('events').EventEmitter var EventEmitter = require('events').EventEmitter
var inherits = require('inherits') var inherits = require('inherits')
var sha1 = require('simple-sha1') var sha1 = require('simple-sha1')
@ -114,6 +115,7 @@ module.exports = function (metadata) {
ut_metadata.prototype.setMetadata = function (metadata) { ut_metadata.prototype.setMetadata = function (metadata) {
if (this._metadataComplete) return true if (this._metadataComplete) return true
debug('set metadata')
// if full torrent dictionary was passed in, pull out just `info` key // if full torrent dictionary was passed in, pull out just `info` key
try { try {

View File

@ -13,6 +13,7 @@
"dependencies": { "dependencies": {
"bencode": "^0.7.0", "bencode": "^0.7.0",
"bitfield": "^1.0.1", "bitfield": "^1.0.1",
"debug": "^2.2.0",
"inherits": "^2.0.1", "inherits": "^2.0.1",
"simple-sha1": "^2.0.0" "simple-sha1": "^2.0.0"
}, },