{"action":"created","issue":{"url":"https://api.github.com/repos/logzio/logzio-nodejs/issues/45","repository_url":"https://api.github.com/repos/logzio/logzio-nodejs","labels_url":"https://api.github.com/repos/logzio/logzio-nodejs/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/logzio/logzio-nodejs/issues/45/comments","events_url":"https://api.github.com/repos/logzio/logzio-nodejs/issues/45/events","html_url":"https://github.com/logzio/logzio-nodejs/issues/45","id":380709075,"node_id":"MDU6SXNzdWUzODA3MDkwNzU=","number":45,"title":"_defaultCallback is called unbound","user":{"login":"matanlb","id":6228875,"node_id":"MDQ6VXNlcjYyMjg4NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/6228875?v=4","gravatar_id":"","url":"https://api.github.com/users/matanlb","html_url":"https://github.com/matanlb","followers_url":"https://api.github.com/users/matanlb/followers","following_url":"https://api.github.com/users/matanlb/following{/other_user}","gists_url":"https://api.github.com/users/matanlb/gists{/gist_id}","starred_url":"https://api.github.com/users/matanlb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matanlb/subscriptions","organizations_url":"https://api.github.com/users/matanlb/orgs","repos_url":"https://api.github.com/users/matanlb/repos","events_url":"https://api.github.com/users/matanlb/events{/privacy}","received_events_url":"https://api.github.com/users/matanlb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-14T13:55:55Z","updated_at":"2018-11-23T10:31:17Z","closed_at":null,"author_association":"NONE","body":"Package Version: 0.4.16\r\n\r\nWe've been working until recently with v0.4.2, since the last auto-update (we do that for patch version) in some scenarios (simples one is no token) the following error will be thrown.\r\n\r\n```\r\n'TypeError: Cannot read property \\'log\\' of undefined',\r\n     '    at LogzioLogger._defaultCallback (/Users/matan/git/bookmd/client/node_modules/logzio-nodejs/lib/logzio-nodejs.js:102:28)',\r\n     '    at Request._callback (/Users/matan/git/bookmd/client/node_modules/logzio-nodejs/lib/logzio-nodejs.js:315:21)',\r\n     '    at Request.self.callback (/Users/matan/git/bookmd/client/node_modules/request/request.js:185:22)',\r\n     '    at emitTwo (events.js:106:13)',\r\n     '    at Request.emit (events.js:191:7)',\r\n     '    at Request.<anonymous> (/Users/matan/git/bookmd/client/node_modules/request/request.js:1161:10)',\r\n     '    at emitOne (events.js:96:13)',\r\n     '    at Request.emit (events.js:188:7)',\r\n     '    at IncomingMessage.<anonymous> (/Users/matan/git/bookmd/client/node_modules/request/request.js:1083:12)',\r\n     '    at IncomingMessage.g (events.js:291:16)',\r\n     '    at emitNone (events.js:91:20)',\r\n     '    at IncomingMessage.emit (events.js:185:7)',\r\n     '    at endReadableNT (_stream_readable.js:974:12)',\r\n     '    at _combinedTickCallback (internal/process/next_tick.js:74:11)',\r\n     '    at process._tickDomainCallback (internal/process/next_tick.js:122:9)'\r\n```\r\n\r\nMultiple places in the package perform the following action:\r\n`var callback = this.callback` or `this.callback = this._defaultCallback` which causes the method to become unbound and when `this.internalLogger.log('logzio-logger error: ' + err, err);` is called an error is thrown.\r\n\r\nThis did not happen in the older version since it used console.log directly. The only usage of this in the older context was `if (err && !this.supressErrors)` so I assume the supressErrors check never had an effect (when called from unbound context)."},"comment":{"url":"https://api.github.com/repos/logzio/logzio-nodejs/issues/comments/441205195","html_url":"https://github.com/logzio/logzio-nodejs/issues/45#issuecomment-441205195","issue_url":"https://api.github.com/repos/logzio/logzio-nodejs/issues/45","id":441205195,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTIwNTE5NQ==","user":{"login":"whostolebenfrog","id":1108776,"node_id":"MDQ6VXNlcjExMDg3NzY=","avatar_url":"https://avatars2.githubusercontent.com/u/1108776?v=4","gravatar_id":"","url":"https://api.github.com/users/whostolebenfrog","html_url":"https://github.com/whostolebenfrog","followers_url":"https://api.github.com/users/whostolebenfrog/followers","following_url":"https://api.github.com/users/whostolebenfrog/following{/other_user}","gists_url":"https://api.github.com/users/whostolebenfrog/gists{/gist_id}","starred_url":"https://api.github.com/users/whostolebenfrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whostolebenfrog/subscriptions","organizations_url":"https://api.github.com/users/whostolebenfrog/orgs","repos_url":"https://api.github.com/users/whostolebenfrog/repos","events_url":"https://api.github.com/users/whostolebenfrog/events{/privacy}","received_events_url":"https://api.github.com/users/whostolebenfrog/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T10:31:17Z","updated_at":"2018-11-23T10:31:17Z","author_association":"NONE","body":"I'm not the bug creator but updating resolves this issue for us."}}
{"actor":{"display_login":"whostolebenfrog"}}