{"action":"created","issue":{"url":"https://api.github.com/repos/winstonjs/winston/issues/741","labels_url":"https://api.github.com/repos/winstonjs/winston/issues/741/labels{/name}","comments_url":"https://api.github.com/repos/winstonjs/winston/issues/741/comments","events_url":"https://api.github.com/repos/winstonjs/winston/issues/741/events","html_url":"https://github.com/winstonjs/winston/issues/741","id":114774374,"number":741,"title":"Logging a class throws a type error","user":{"login":"cleancoderocker","id":414107,"avatar_url":"https://avatars.githubusercontent.com/u/414107?v=3","gravatar_id":"","url":"https://api.github.com/users/cleancoderocker","html_url":"https://github.com/cleancoderocker","followers_url":"https://api.github.com/users/cleancoderocker/followers","following_url":"https://api.github.com/users/cleancoderocker/following{/other_user}","gists_url":"https://api.github.com/users/cleancoderocker/gists{/gist_id}","starred_url":"https://api.github.com/users/cleancoderocker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cleancoderocker/subscriptions","organizations_url":"https://api.github.com/users/cleancoderocker/orgs","repos_url":"https://api.github.com/users/cleancoderocker/repos","events_url":"https://api.github.com/users/cleancoderocker/events{/privacy}","received_events_url":"https://api.github.com/users/cleancoderocker/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-03T09:22:57Z","updated_at":"2015-11-03T09:24:25Z","closed_at":"2015-11-03T09:24:25Z","body":"If you try to call `debug()`, `error()`, `warn()` or `info()` with an ES6 class as parameter a `TypeError` is thrown. This happens because winston calls the constructor of the class (which of course is a function) without the `new` keyword. Also see this issue: #740.\r\n\r\n```javascript\r\nlet winston = require('winston');\r\nclass SimpleClass {}\r\nwinston.debug(SimpleClass);   // TypeError\r\nwinston.error(SimpleClass);   // TypeError\r\nwinston.warn(SimpleClass);    // TypeError\r\nwinston.info(SimpleClass);    // TypeError\r\n```"},"comment":{"url":"https://api.github.com/repos/winstonjs/winston/issues/comments/153295808","html_url":"https://github.com/winstonjs/winston/issues/741#issuecomment-153295808","issue_url":"https://api.github.com/repos/winstonjs/winston/issues/741","id":153295808,"user":{"login":"indexzero","id":4624,"avatar_url":"https://avatars.githubusercontent.com/u/4624?v=3","gravatar_id":"","url":"https://api.github.com/users/indexzero","html_url":"https://github.com/indexzero","followers_url":"https://api.github.com/users/indexzero/followers","following_url":"https://api.github.com/users/indexzero/following{/other_user}","gists_url":"https://api.github.com/users/indexzero/gists{/gist_id}","starred_url":"https://api.github.com/users/indexzero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indexzero/subscriptions","organizations_url":"https://api.github.com/users/indexzero/orgs","repos_url":"https://api.github.com/users/indexzero/repos","events_url":"https://api.github.com/users/indexzero/events{/privacy}","received_events_url":"https://api.github.com/users/indexzero/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T09:24:25Z","updated_at":"2015-11-03T09:24:25Z","body":"This API changes pretty drastically in `3.0.0`. Going to close this. If you'd like to submit a PR for the `2.x` branch it would be welcome."}}