console-to-terminal is a small utility to redirect console output (log, warn, error, info or trace) to the terminal. It is really handy while debugging web applications without a possibility to check console in DevTool (Chrome on iOS or custom "native" browsers on Androids).
- Clone repo and run
yarn
to install dependencies - Run
yarn start
to start server. By defaut it is run onlocalhost:8765
. Host and port could be modified if server started withyarn start port
oryarn start host:port
. - Add
<script src="http://my-local-ip:port/console-hook.js"></script>
to your web application's entry point. It will install custom hooks for console methods and will make requests to running server. - In case you want to load hooks script from your own endpoint, you need to specify
window["__consoleToTerminalLocation__"]
object with host and port properties. E.g.,window["__consoleToTerminalLocation__"] = { host: "127.0.0.1", port: 8000 }
.
Simply run server as described in Usage section and navigate to http://host:port/demo
(http://localhost:8765/demo) by default.