Skip to content

Document no-op console methods #16755

Description

@unional

I just noticed starting from Node@8, console.debug() is defined but it is a no-op.

This causes my library to not behaving correctly.

It would be better to at least mention in the documentation that they are there but are no-op.

Are any of these has the same problem?
#1716 (comment)

Activity

  1. added
    consoleIssues and PRs related to the console subsystem.
    docIssues and PRs related to Node.js documentation.
    on Nov 4, 2017
  2. maclover7 commented on Nov 4, 2017

    @maclover7
    Contributor

    relevant #12675

  3. added
    good first issueIssues that are suitable for first-time contributors.
    on Nov 4, 2017
  4. Tiriel commented on Nov 5, 2017

    @Tiriel
    Contributor

    Hi there! I'd like to pick this one up as my first contrib to core.
    Already forked and built+tested the repo.

    Any more information you can give me on this one, just in case?

  5. Tiriel commented on Nov 5, 2017

    @Tiriel
    Contributor

    From what I see, based on #12675 and on lib/console.js, these functions are all non-op:

    console.debug                 console.dirxml                console.markTimeline
    console.profile               console.profileEnd            console.table
    console.timeStamp             console.timeline              console.timelineEnd 

    Can someone confirm/infirm?

  6. daguej commented on Nov 6, 2017

    @daguej
    Contributor

    These are NOT actually no-ops!

    All of the new-to-node console methods (that @Tiriel listed above) are real implementations for the Inspector. ie, they may appear to be no-ops unless you're running node with the --inspect option and then open chrome://inspect in Chrome and attach to your process. In the inspector's console, you'll see the results of using these methods (eg console.debug, console.profile, etc...); but you will not see anything on stdout.

    There is no indication of these methods' existence in lib/console.js because they are not implemented in node. The methods were added by V8 starting with node v8.0 and are copied to node's console global.


    Also, depending on how #15579 shakes out, this may be moot since that PR may end up removing these undocumented console methods.

  7. Tiriel commented on Nov 7, 2017

    @Tiriel
    Contributor

    Thanks for the input @daguej !
    I'll check what comes out of this PR and see if this issue needs closing then.

    If not, what about adding a new section 'Inspector only methods' explaining the deal and listing these methods?

  8. Tiriel commented on Nov 13, 2017

    @Tiriel
    Contributor

    Okay, trying to wrap my head around a first draft just in case.

    As a first timer would-be committer, is there anything I should know? Are there some things automatically generated? Am I to write directly yhe markdown in the doc folder or is it somewhere else? In short, if someone as any kind of advice/how-to to provide me, that would be great.

  9. TimothyGu commented on Nov 13, 2017

    @TimothyGu
    Member

    @Tiriel There are nothing in doc/ that is automatically generated; directly editing the markdown files is enough.

  10. Tiriel commented on Nov 13, 2017

    @Tiriel
    Contributor

    @TimothyGu Awesome, thanks!

  11. 41 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    consoleIssues and PRs related to the console subsystem.docIssues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions