Skip to content

Setting log: false breaks socket.io in manager.js #540

Closed
@dimroc

Description

@dimroc

Hi all,
Let me start of with thanks for a great library.

I'm currently encountering a repeat of issues #491 and #400.
Couldn't reopen the issue but this is clearly a recurring bug.
Write regression unit tests much?

function Manager (server, options) {
  this.server = server;
  this.namespaces = {};
  this.sockets = this.of('');
  this.settings = {
      origins: '*:*'
    , log: true  // io.set('log', 'false'); will lead to an error in manager.js shown below
    , store: new MemoryStore
    , logger: new Logger
    , static: new Static(this)
    , heartbeats: true
    , resource: '/socket.io'
    , transports: defaultTransports
    , authorization: false
    , 'log level': 3
    , 'close timeout': 25
    , 'heartbeat timeout': 15
    , 'heartbeat interval': 20
    , 'polling duration': 20
    , 'flash policy server': true
    , 'flash policy port': 10843
    , 'destroy upgrade': true
    , 'browser client': true
    , 'browser client cache': true
    , 'browser client minification': false
    , 'browser client etag': false
    , 'browser client gzip': false
    , 'browser client handler': false
    , 'client store expiration': 15
  };

Error:

/Users/dimroc/Repos/git/nko2/node_modules/zappa/node_modules/socket.io/lib/manager.js:727
self.log.debug('served static ' + data.path);
^
TypeError: Cannot call method 'debug' of undefined
at serve (/Users/dimroc/Repos/git/nko2/node_modules/zappa/node_modules/socket.io/lib/manager.js:727:14)
at /Users/dimroc/Repos/git/nko2/node_modules/zappa/node_modules/socket.io/lib/manager.js:746:7
at [object Object]. (fs.js:107:5)
at [object Object].emit (events.js:61:17)
at afterRead (fs.js:878:12)
at wrapper (fs.js:245:17)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions