Search code examples
javascriptrshinyshiny-server

Is there an equivalent to javascipt's console.log() in Shiny?


I want to log some messages to the javascript console from a Shiny application as an alternative to writing to the server-side logs. Shiny does this when an error gets thrown in the application. Is there a generic way to do this?


Solution

  • This worked for me when I put it in server.R:

    cat("Hello world!\n", file = stderr())