http://wiki.webos-internals.org/index.php?title=Patch_webOS_Logging_Information_from_Within_Scripts&feed=atom&action=historyPatch webOS Logging Information from Within Scripts - Revision history2024-03-29T04:54:24ZRevision history for this page on the wikiMediaWiki 1.35.1http://wiki.webos-internals.org/index.php?title=Patch_webOS_Logging_Information_from_Within_Scripts&diff=20427&oldid=prevJohnTomawski at 16:34, 6 December 20112011-12-06T16:34:44Z<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:34, 6 December 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l8" >Line 8:</td>
<td colspan="2" class="diff-lineno">Line 8:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Mojo supports three levels of logging at this time: Mojo.Log.error, Mojo.Log.warning and Mojo.Log.info. These correspond to the values 0, 10 and 20, respectively. If you change that logLevel to a value greater than 0, 10 or 20, then **all** of that level and lower Mojo.Log statements will log each time that application is run. At this time it appears that a reboot of the Pre is required to cause this change to take effect. As logging consumes resources, it is suggested that once you complete your debugging, you reset the value back to zero and reboot your Pre to clear logging.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Mojo supports three levels of logging at this time: Mojo.Log.error, Mojo.Log.warning and Mojo.Log.info. These correspond to the values 0, 10 and 20, respectively. If you change that logLevel to a value greater than 0, 10 or 20, then **all** of that level and lower Mojo.Log statements will log each time that application is run. At this time it appears that a reboot of the Pre is required to cause this change to take effect. As logging consumes resources, it is suggested that once you complete your debugging, you reset the value back to zero and reboot your Pre to clear logging.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">NB: It may be necessary to change the logLevel value to a much higher value, eg. 99.</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Once the value has been changed and the Pre rebooted, Mojo.Log output values will be visable in ///var/log/messages//. An easy way to watch them is to ssh into your rooted Pre and type</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Once the value has been changed and the Pre rebooted, Mojo.Log output values will be visable in ///var/log/messages//. An easy way to watch them is to ssh into your rooted Pre and type</div></td></tr>
</table>JohnTomawskihttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Logging_Information_from_Within_Scripts&diff=3664&oldid=prevHopspitfire at 08:53, 3 August 20092009-08-03T08:53:46Z<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:53, 3 August 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{template:patch}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>One of the most basic forms of debugging information available is to print a message. By liberally scattering such print statements throughout code, you can see the value of certain variables within your code. Mojo provides this functionality using the the equivalent of Unix syslog from within applications.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>One of the most basic forms of debugging information available is to print a message. By liberally scattering such print statements throughout code, you can see the value of certain variables within your code. Mojo provides this functionality using the the equivalent of Unix syslog from within applications.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>Hopspitfirehttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Logging_Information_from_Within_Scripts&diff=3614&oldid=prevHopspitfire: Logging information from within scripts moved to Patch webOS Logging Information from Within Scripts: webOS patch2009-08-03T08:41:41Z<p><a href="/wiki/Logging_information_from_within_scripts" class="mw-redirect" title="Logging information from within scripts">Logging information from within scripts</a> moved to <a href="/wiki/Patch_webOS_Logging_Information_from_Within_Scripts" title="Patch webOS Logging Information from Within Scripts">Patch webOS Logging Information from Within Scripts</a>: webOS patch</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:41, 3 August 2009</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Hopspitfirehttp://wiki.webos-internals.org/index.php?title=Patch_webOS_Logging_Information_from_Within_Scripts&diff=1422&oldid=prevHopspitfire: New page: One of the most basic forms of debugging information available is to print a message. By liberally scattering such print statements throughout code, you can see the value of certain varia...2009-07-21T22:42:27Z<p>New page: One of the most basic forms of debugging information available is to print a message. By liberally scattering such print statements throughout code, you can see the value of certain varia...</p>
<p><b>New page</b></p><div>One of the most basic forms of debugging information available is to print a message. By liberally scattering such print statements throughout code, you can see the value of certain variables within your code. Mojo provides this functionality using the the equivalent of Unix syslog from within applications.<br />
<br />
Looking in the home directory of an application, you should see a file named //framework_config.json//. An example of a full path to this file would be ///usr/palm/applications/com.palm.app.messaging/framework_config.json//. A stock version of this file will most likely contain the sequence:<br />
<pre><nowiki>{<br />
"logLevel": 0<br />
}</nowiki></pre><br />
<br />
Mojo supports three levels of logging at this time: Mojo.Log.error, Mojo.Log.warning and Mojo.Log.info. These correspond to the values 0, 10 and 20, respectively. If you change that logLevel to a value greater than 0, 10 or 20, then **all** of that level and lower Mojo.Log statements will log each time that application is run. At this time it appears that a reboot of the Pre is required to cause this change to take effect. As logging consumes resources, it is suggested that once you complete your debugging, you reset the value back to zero and reboot your Pre to clear logging.<br />
<br />
Once the value has been changed and the Pre rebooted, Mojo.Log output values will be visable in ///var/log/messages//. An easy way to watch them is to ssh into your rooted Pre and type<br />
<pre><nowiki>tail -f /var/log/messages</nowiki></pre><br />
which will generate a scrolling log of this file including the Mojo.Log messages (as well as additional system information). To stop the tail, use ^C (Control-C).<br />
<br />
In its most basic form, Mojo.Log simply concatenates together the passed values and prints them. Some additional formatting options are available, see the file ///usr/palm/frameworks/mojo/submissions/175.7/javascripts/log.js// on your Pre for additional information.</div>Hopspitfire