Skip to content

Should (prn my-map) be doing a pretty print in console? mine doesn't...  #58

Description

@mikew1

Hi, I have cljs-devtools installed, I get the notification in the console that :formatters is active, and I sometimes see colored, formatted clojure data structures, but I was hoping that when I do (prn my-map) within some cljs source file, that would justify and color a large map. I'm just getting a regular print of the datastructure in the console, same as when cljs-devtools is not active. Am I doing something wrong? Thanks.

Activity

  1. mikew1 commented on Dec 16, 2020

    @mikew1
    Author

    Apologies, it was my lack of experience with cljs that was the issue here. Once I realised that studying the code in the screenshot on the docs page is absolutely crucial, I got it fine. My error was to be using prn instead of console.log (prn does print to the console after all!), but for the formatters to work, it seems it's essential to use .log js/console and not prn/println.

    The only way I found this out was by carefully studying the code in the screenshot, as this isn't pointed out in the main text of the docs anywhere...

    Would you like a pull request on the FAQ page adding a couple of lines to make it clear, (in the main markdown text), what exactly is being shown in the screenshot? This might reduce an occasional beginner's head scratching.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions