Skip to content

Commit

Permalink
Better browser compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jhs committed Sep 1, 2011
1 parent 7eacc96 commit 03849ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// limitations under the License.

var lib = require('./lib')
, url = require('url')
, util = require('util')
, events = require('events')
, request = require('request')
Expand All @@ -29,9 +28,11 @@ var INITIAL_RETRY_DELAY = 1000;

var FEED_PARAMETERS = ['since', 'limit', 'feed', 'heartbeat', 'filter', 'include_docs'];

var EventEmitter = events.EventEmitter2 || events.EventEmitter;

function Feed (opts) {
var self = this;
events.EventEmitter.call(self);
EventEmitter.call(self);

self.feed = 'continuous';
self.heartbeat = DEFAULT_HEARTBEAT;
Expand Down Expand Up @@ -70,7 +71,7 @@ function Feed (opts) {
*/

} // Feed
util.inherits(Feed, events.EventEmitter);
util.inherits(Feed, EventEmitter);

Feed.prototype.start =
Feed.prototype.follow = function follow_feed() {
Expand All @@ -85,8 +86,7 @@ Feed.prototype.follow = function follow_feed() {
if(typeof self.heartbeat !== 'number')
throw new Error('Required "heartbeat" value');

var parsed = url.parse(self.db);
self.log = lib.log4js().getLogger(parsed.hostname + parsed.pathname);
self.log = lib.log4js().getLogger(self.db);
self.log.setLevel(process.env.changes_level || "info");

self.emit('start');
Expand Down

0 comments on commit 03849ff

Please sign in to comment.