Skip to content

Commit 1f9ddee

Browse files
committed
Remove the need of log in src/index.js
1 parent 89bd13d commit 1f9ddee

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"@commitlint/cli": "^10.0.0",
7878
"@commitlint/config-conventional": "^16.2.1",
7979
"@icetee/ftp": "^1.0.2",
80+
"bunyan": "^1.8.15",
8081
"chai": "^4.2.0",
8182
"condition-circle": "^2.0.2",
8283
"eslint": "^5.14.1",

src/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const _ = require('lodash');
22
const Promise = require('bluebird');
33
const nodeUrl = require('url');
4-
const buyan = require('bunyan');
54
const net = require('net');
65
const tls = require('tls');
76
const EventEmitter = require('events');
@@ -13,7 +12,6 @@ class FtpServer extends EventEmitter {
1312
constructor(options = {}) {
1413
super();
1514
this.options = Object.assign({
16-
log: buyan.createLogger({name: 'ftp-srv'}),
1715
url: 'ftp://127.0.0.1:21',
1816
pasv_min: 1024,
1917
pasv_max: 65535,
@@ -52,7 +50,7 @@ class FtpServer extends EventEmitter {
5250
socket.once('close', () => {
5351
this.emit('disconnect', {connection, id: connection.id, newConnectionCount: Object.keys(this.connections).length});
5452
})
55-
53+
5654
this.emit('connect', {connection, id: connection.id, newConnectionCount: Object.keys(this.connections).length});
5755

5856
const greeting = this._greeting || [];
@@ -67,7 +65,7 @@ class FtpServer extends EventEmitter {
6765
this.log.error(err, '[Event] error');
6866
this.emit('server-error', {error: err});
6967
});
70-
68+
7169
const quit = _.debounce(this.quit.bind(this), 100);
7270

7371
process.on('SIGTERM', quit);
@@ -138,7 +136,7 @@ class FtpServer extends EventEmitter {
138136
} catch (err) {
139137
this.log.error(err, 'Error closing connection', {id});
140138
}
141-
139+
142140
resolve('Disconnected');
143141
});
144142
}

0 commit comments

Comments
 (0)