Skip to content

Export console logging functions to extensions #1886

Description

@westonruter

I just learned about console.context() via https://devtoolstips.org/tips/en/create-contextual-console-loggers/

This can be used to filter messages by the context via the context: operator in the filter search box.

We could create info, warn, and log, error functions which we expose to the client-side extensions' initialize() and finalize() functions as well. Maybe these functions could automatically take into account the value of isDebug coming from WP_DEBUG in PHP, so that they automatically no-op when called. That would avoid the need to wrap calls in if ( isDebug ) { ... } all the time in extensions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done 😃

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions