binaryage / binaryage/cljs-devtools

Detection of support for custom formatters doesn't work

Offen
#80 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Clojure
Sterne
1.1k
Forks
51
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi,

The mechanism used to detect support for custom formatters doesn't work. It will always report that custom formatters are not supported or that support is disabled. This is due to the fact that the detection mechanism relies on the application of a custom formatter when strings are logged to the console. However, custom formatters are not applied when logging strings. They are only applied when logging objects.

Executing the following statements in the console will demonstrate this:

```
window.devtoolsFormatters = [{"header": () => {console.count("formatter"); return null;}}]
console.log("string")
console.log({})
```

You'll see that the counter "formatter" is only increased once, when the last statement is executed. I see the same behavior using both Chrome and Firefox.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.