Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending IDebugger doesn't retain the .log function #646

Closed
uphlewis opened this issue Dec 18, 2018 · 3 comments
Closed

Extending IDebugger doesn't retain the .log function #646

uphlewis opened this issue Dec 18, 2018 · 3 comments
Assignees
Labels
bug This issue identifies a malfunction change-patch This proposes or provides a change that requires a patch release help-wanted This issue has an actionable item pr-welcome This issue has an approved change; a pull request would be appreciated
Milestone

Comments

@uphlewis
Copy link

uphlewis commented Dec 18, 2018

const debug = require('debug');
const log = debug('app');
log.log = console.log.bind(console); //log to stdout

log('Stdout test'); //writes "app Stdout test" to stdout 
log.extend('extended')('Stdout test'); //writes "app:extended Stdout test" to stderr 

Bit annoying if i want to have a base IDebugger for stdout and another for stderr, but i have to re-bind console.log whenever i want to extend the stdout debugger.

@Qix-
Copy link
Member

Qix- commented Dec 18, 2018

Yep, confirmed. Great catch :)

@Qix- Qix- added bug This issue identifies a malfunction change-patch This proposes or provides a change that requires a patch release help-wanted This issue has an actionable item pr-welcome This issue has an approved change; a pull request would be appreciated labels Dec 18, 2018
@Qix- Qix- self-assigned this Dec 18, 2018
@Qix- Qix- added this to the 5.x milestone Dec 18, 2018
@Qix- Qix- closed this as completed in #660 Dec 19, 2018
@Qix-
Copy link
Member

Qix- commented Dec 22, 2018

Backported to 4.1.1.

@apparatusdeus
Copy link

Is this now part of 4.1.1 because I'm currently using that build but when I extend the log function is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue identifies a malfunction change-patch This proposes or provides a change that requires a patch release help-wanted This issue has an actionable item pr-welcome This issue has an approved change; a pull request would be appreciated
Development

No branches or pull requests

3 participants