<!DOCTYPE HTML> <html lang="" > <head> <meta charset="UTF-8"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>Debugging ยท GitBook</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="description" content=""> <meta name="generator" content="GitBook 3.2.2"> <link rel="stylesheet" href="../gitbook/style.css"> <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css"> <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css"> <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css"> <meta name="HandheldFriendly" content="true"/> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png"> <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon"> <link rel="next" href="development.html" /> </head> <body> <div class="book"> <div class="book-summary"> <div id="book-search-input" role="search"> <input type="text" placeholder="Type to search" /> </div> <nav role="navigation"> <ul class="summary"> <li class="chapter " data-level="1.1" data-path="../"> <a href="../"> Introduction </a> </li> <li class="chapter " data-level="1.2" data-path="tutorial.html"> <a href="tutorial.html"> Getting Started </a> </li> <li class="chapter " data-level="1.3" data-path="install.html"> <a href="install.html"> Install </a> </li> <li class="chapter " data-level="1.4" > <span> API </span> <ul class="articles"> <li class="chapter " data-level="1.4.1" data-path="../api/app.html"> <a href="../api/app.html"> Ovto::App </a> </li> <li class="chapter " data-level="1.4.2" data-path="../api/state.html"> <a href="../api/state.html"> Ovto::State </a> </li> <li class="chapter " data-level="1.4.3" data-path="../api/actions.html"> <a href="../api/actions.html"> Ovto::Actions </a> </li> <li class="chapter " data-level="1.4.4" data-path="../api/component.html"> <a href="../api/component.html"> Ovto::Component </a> </li> <li class="chapter " data-level="1.4.5" data-path="../api/pure_component.html"> <a href="../api/pure_component.html"> Ovto::PureComponent </a> </li> <li class="chapter " data-level="1.4.6" data-path="../api/middleware.html"> <a href="../api/middleware.html"> Ovto::Middleware </a> </li> <li class="chapter " data-level="1.4.7" data-path="../api/fetch.html"> <a href="../api/fetch.html"> Ovto.fetch </a> </li> </ul> </li> <li class="chapter " data-level="1.5" > <span> Guides </span> <ul class="articles"> <li class="chapter active" data-level="1.5.1" data-path="debugging.html"> <a href="debugging.html"> Debugging </a> </li> <li class="chapter " data-level="1.5.2" data-path="development.html"> <a href="development.html"> Development </a> </li> </ul> </li> <li class="divider"></li> <li> <a href="https://www.gitbook.com" target="blank" class="gitbook-link"> Published with GitBook </a> </li> </ul> </nav> </div> <div class="book-body"> <div class="body-inner"> <div class="book-header" role="navigation"> <!-- Title --> <h1> <i class="fa fa-circle-o-notch fa-spin"></i> <a href=".." >Debugging</a> </h1> </div> <div class="page-wrapper" tabindex="-1" role="main"> <div class="page-inner"> <div id="book-search-results"> <div class="search-noresults"> <section class="normal markdown-section"> <h1 id="debugging-ovto-app">Debugging Ovto app</h1> <h2 id="consolelog">console.log</h2> <p>In an Ovto app, you can print any object to developer console by <code>console.log</code> like in JavaScript. </p> <pre><code class="lang-rb">console.log(<span class="hljs-symbol">state:</span> State.new) </code></pre> <p>This is mostly equal to <code>p state: State.new</code> but <code>console.log</code> supports JavaScript objects too.</p> <p>(Note: this is not an official feature of Opal. You can do this setup by this:)</p> <pre><code class="lang-rb"> <span class="hljs-keyword">require</span> <span class="hljs-string">'console'</span>; <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">console</span>;</span> $console; <span class="hljs-keyword">end</span> </code></pre> <h2 id="ovto-debug">ovto-debug</h2> <p>If the page has a tag with <code>id='ovto-debug'</code>, exception is shown in the tag.</p> <h2 id="ovtodebugtrace">Ovto.debug_trace</h2> <p>If <code>Ovto.debug_trace</code> is set to <code>true</code>, some diagnostic messages are shown in the browser console.</p> <pre><code class="lang-rb">Ovto.debug_trace = <span class="hljs-keyword">true</span> MyApp.run(<span class="hljs-symbol">id:</span> <span class="hljs-string">'ovto'</span>) </code></pre> </section> </div> <div class="search-results"> <div class="has-results"> <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1> <ul class="search-results-list"></ul> </div> <div class="no-results"> <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1> </div> </div> </div> </div> </div> </div> <a href="development.html" class="navigation navigation-next navigation-unique" aria-label="Next page: Development"> <i class="fa fa-angle-right"></i> </a> </div> <script> var gitbook = gitbook || []; gitbook.push(function() { gitbook.page.hasChanged({"page":{"title":"Debugging","level":"1.5.1","depth":2,"next":{"title":"Development","level":"1.5.2","depth":2,"path":"guides/development.md","ref":"guides/development.md","articles":[]},"previous":{"title":"Guides","level":"1.5","depth":1,"ref":"","articles":[{"title":"Debugging","level":"1.5.1","depth":2,"path":"guides/debugging.md","ref":"guides/debugging.md","articles":[]},{"title":"Development","level":"1.5.2","depth":2,"path":"guides/development.md","ref":"guides/development.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"guides/debugging.md","mtime":"2018-12-24T11:59:38.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2020-02-29T14:26:27.632Z"},"basePath":"..","book":{"language":""}}); }); </script> </div> <script src="../gitbook/gitbook.js"></script> <script src="../gitbook/theme.js"></script> <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script> <script src="../gitbook/gitbook-plugin-search/search.js"></script> <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script> <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script> <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script> <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script> </body> </html>