HISE Logo Forum
    • Categories
    • Register
    • Login

    Can I pipe the Console output to std out

    Scheduled Pinned Locked Moved C++ Development
    12 Posts 3 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d.healeyD
      d.healey @jonhallur
      last edited by

      @jonhallur There's a Console.breakInDebugger() command but I don't see anything to forward the output of .print()

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      jonhallurJ 2 Replies Last reply Reply Quote 0
      • jonhallurJ
        jonhallur @d.healey
        last edited by

        @d-healey Thats a great start

        1 Reply Last reply Reply Quote 0
        • jonhallurJ
          jonhallur @d.healey
          last edited by

          @d-healey said in Can I pipe the Console output to std out:

          @jonhallur There's a Console.breakInDebugger() command but I don't see anything to forward the output of .print()

          Unless I'm missing some compile option, running the ExternalFloatingTileTest in under Debug in VS2017 does not appear to to break.

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @jonhallur
            last edited by

            @jonhallur I've never used it so perhaps it isn't designed for this use case.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            jonhallurJ 1 Reply Last reply Reply Quote 0
            • jonhallurJ
              jonhallur @d.healey
              last edited by

              @d-healey said in Can I pipe the Console output to std out:

              @jonhallur I've never used it so perhaps it isn't designed for this use case.

              It was a good idea

              Christoph HartC 1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @jonhallur
                last edited by

                @jonhallur If you're running in the debugger, the HiseScript console output gets also printed to the VS debugger using the DBG() macro from JUCE.

                The Console.break() function just throws an assertion so you can inspect the C++ callstack.

                jonhallurJ 1 Reply Last reply Reply Quote 1
                • jonhallurJ
                  jonhallur @Christoph Hart
                  last edited by

                  @christoph-hart said in Can I pipe the Console output to std out:

                  @jonhallur If you're running in the debugger, the HiseScript console output gets also printed to the VS debugger using the DBG() macro from JUCE.

                  The Console.break() function just throws an assertion so you can inspect the C++ callstack.

                  I of course meant the DBG output, not std out, which works fine for my C++ code, but nothing I write using Javascript Console.print shows up in my VS Output window. It only shows up when I'm running inside HiseStandalone application.

                  For example, I have a ScriptButton on the Hise side which when pressed prints some stuff to the JS console, which works when inside HiseStandalone application and shows up in the Hise console window under Hise code editor, but when I generate the C++ project (I am using the ExternalFloatingTileTest from the hise_tutorial project on GitHub), and run it under VS and press that same button nothing shows up in VS Output window, where I can see all my DBG lines from the C++ code.

                  Christoph HartC 1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart @jonhallur
                    last edited by

                    @jonhallur Ah yes, you're right - it just redirects script errors to DBG in the compiled version.

                    Just add DBG(x.toString()) before this line and you're good.

                    Link Preview Image
                    HISE/hi_scripting/scripting/api/ScriptingApi.cpp at 799e337ad74a34ec76b15b1e294c65235bc6fcfc · christophhart/HISE

                    The open source framework for sample based instruments - HISE/hi_scripting/scripting/api/ScriptingApi.cpp at 799e337ad74a34ec76b15b1e294c65235bc6fcfc · christophhart/HISE

                    favicon

                    GitHub (github.com)

                    jonhallurJ 2 Replies Last reply Reply Quote 0
                    • jonhallurJ
                      jonhallur @Christoph Hart
                      last edited by

                      @christoph-hart Thanks

                      1 Reply Last reply Reply Quote 0
                      • jonhallurJ
                        jonhallur @Christoph Hart
                        last edited by jonhallur

                        @christoph-hart While this works for when running the Hise standalone editor, it does not appear to work when I export a Hise preset to it's own VS standalone project and build and run the debug version.

                        Christoph HartC 1 Reply Last reply Reply Quote 0
                        • Christoph HartC
                          Christoph Hart @jonhallur
                          last edited by

                          You're right (I keep forgetting about the layers I've added to the debug handling). All Console.xxx() calls are ignored in the compiled plugin (in fact they are thrown away by the HiseScript compiler when parsing the Javascript code). This is to prevent that any residual debugging code ends up clogging the finished product.

                          You can remove this by removing everything inside this preprocessing definition:

                          Link Preview Image
                          HISE/hi_scripting/scripting/engine/JavascriptEngineParser.cpp at 2da59a219ce25c10b6d9d9ee3e1ca0da18850940 · christophhart/HISE

                          The open source framework for sample based instruments - HISE/hi_scripting/scripting/engine/JavascriptEngineParser.cpp at 2da59a219ce25c10b6d9d9ee3e1ca0da18850940 · christophhart/HISE

                          favicon

                          GitHub (github.com)

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post

                          21

                          Online

                          1.7k

                          Users

                          11.9k

                          Topics

                          103.6k

                          Posts