| Index: native_client_sdk/src/doc/devguide/devcycle/debugging.rst
|
| diff --git a/native_client_sdk/src/doc/devguide/devcycle/debugging.rst b/native_client_sdk/src/doc/devguide/devcycle/debugging.rst
|
| index 326ac22b6f379652e7634222c1c67d138a937e59..d68fede2d8020e715f25b3ac2814bfb6b66c0cff 100644
|
| --- a/native_client_sdk/src/doc/devguide/devcycle/debugging.rst
|
| +++ b/native_client_sdk/src/doc/devguide/devcycle/debugging.rst
|
| @@ -114,61 +114,6 @@ variable as follows:
|
| the ``--no-sandbox`` flag. You must also be careful that each variable points
|
| to a different file.
|
|
|
| -Redirecting output to the JavaScript console
|
| -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| -
|
| -You can also cause output from printf statements in your C/C++ code to be
|
| -relayed to the JavaScript side of your application through the Pepper messaging
|
| -system, where you can then write the output to the JavaScript console. Follow
|
| -these steps:
|
| -
|
| -#. Set the ``NACL_EXE_STDOUT`` and ``NACL_EXE_STDERR`` environment variables as
|
| - follows:
|
| -
|
| - * ``NACL_EXE_STDOUT=DEBUG_ONLY:dev://postmessage``
|
| - * ``NACL_EXE_STDERR=DEBUG_ONLY:dev://postmessage``
|
| -
|
| - These settings tell Native Client to use ``PostMessage()`` to send output
|
| - that your Native Client module writes to stdout and stderr to the JavaScript
|
| - side of your application.
|
| -
|
| -#. Register a JavaScript handler to receive messages from your Native Client
|
| - module:
|
| -
|
| - .. naclcode::
|
| -
|
| - <div id="nacl_container">
|
| - <script type="text/javascript">
|
| - var container = document.getElementById('nacl_container');
|
| - container.addEventListener('message', handleMessage, true);
|
| - </script>
|
| - <embed id="nacl_module"
|
| - src="my_application.nmf"
|
| - type="application/x-nacl" />
|
| - </div>
|
| -
|
| -#. Implement a simple JavaScript handler that logs the messages it receives to
|
| - the JavaScript console:
|
| -
|
| - .. naclcode::
|
| -
|
| - function handleMessage(message_event) {
|
| - console.log(message_event.data);
|
| - }
|
| -
|
| - This handler works in the simple case where the only messages your Native
|
| - Client module sends to JavaScript are messages with the output from stdout
|
| - and stderr. If your Native Client module also sends other messages to
|
| - JavaScript, your handler will need to be more complex.
|
| -
|
| - Once you've implemented a message handler and set up the environment
|
| - variables as described above, you can check the JavaScript console to see
|
| - output that your Native Client module prints to stdout and stderr. Keep in
|
| - mind that your module makes a call to ``PostMessage()`` every time it flushes
|
| - stdout or stderr. Your application's performance will degrade considerably
|
| - if your module prints and flushes frequently, or if it makes frequent Pepper
|
| - calls to begin with (e.g., to render).
|
| -
|
| Logging calls to Pepper interfaces
|
| ----------------------------------
|
|
|
|
|