Use console.context()
for logging in Optimization Detective and export console logging functions to extensions
#1886
Labels
[Plugin] Optimization Detective
Issues for the Optimization Detective plugin
[Type] Enhancement
A suggestion for improvement of an existing feature
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
, andlog
,error
functions which we expose to the client-side extensions'initialize()
andfinalize()
functions as well. Maybe these functions could automatically take into account the value ofisDebug
coming fromWP_DEBUG
in PHP, so that they automatically no-op when called. That would avoid the need to wrap calls inif ( isDebug ) { ... }
all the time in extensions.The text was updated successfully, but these errors were encountered: