Approved, but I have some corrections/suggestions.
This:
onselect="Debug.debug('%w', 'the [Ctrl-n] key combination was
pressed');
Could be simplified:
onselect="Debug.debug('the [Ctrl-n] key combination was pressed');
If all you are outputting is a string, then that can be the control
string.
Oh, you could be cute and say:
<command key="$once{['Control','n']}"
onselect="Debug.debug('the %w key combination was pressed',
this.keys);" />
(Don't ask me why the attribute you set is called `key`, but the
attribute you read is called `keys`. This is one of those carefully
thought out API designs that we daren't change...)
---
Here:
Debug.debug('LPS version %s', canvas.lpsversion)
Might be a good place to mention (and demonstrate)
Debug.versionInfo();
which will print out a full description of what you are running.
Which can be useful for bug reports (although Debug.bugReport() is
better).
---
In places where you are not accumulating text (so don't need addText)
it would be worthwhile to show the use of text.format:
message.addText("\nmyfoo is " + this.myfoo);
might be better as:
message.format("myfoo is %w", this.myfoo);
Maybe there should be an appending version of format? What would be a
good name for that? formatAppend?
---
This:
Debug.debug("container construct %w %w", parent, args);
Could be made cuter by saying:
Debug.debug("%w(%w, %w)", this.arguments.callee, parent, args);
But let's not. Actually, there probably should be some simple debug
method if I just want to trace a function. There is, it is called
Debug.trace, but it is too hard to use, because users don't know how
to get to the method they want to trace. I'll just file a bug. http://jira.openlaszlo.org/jira/browse/LPP-7451
---
Debug.debug("%s", "-----");
could just be:
Debug.debug("-----");
---
Looke like an extra `=` here:
Debug.debug("newnode= = %w", newnode);
---
I think you lost the spirit of this:
Debug.debug("%w %w %w", description, usPerOp , "us");
It should be:
Debug.debug("%w: %dµs", description, usPerOp);
You can also say:
Debug.debug("%w: %d\xB5s", description, usPerOp);
If you want to avoid typing a literal µ.
---
This:
Debug.debug('error: %w', retval.message);
Might be a good place to use Debug.error?
Debug.error('%w', retval.message);
Or be really fancy and make inspecting the message reveal the entire
retval object:
Debug.error('%=s', retval, retval.message);
[That will display the message, but if you click on it, you see the
whole retval object.]
---
Another place were Debug.error might be better (in several RPC
examples):
Debug.debug('error: %w', error);
You _can_ just say:
Debug.error(error);
Although it might be better to say:
Debug.error("RPC error: %w", error);
Ditto for the timeout handler:
Debug.error("RPC timeout: %w", error);
On 2008-12-11, at 09:50EST, Lou Iorio wrote:
Change 20081211-lou-0 by [EMAIL PROTECTED] on 2008-12-11 10:37:00 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: dguide: emphasize Debug.debug over Debug.write in
documentation examples
Bugs Fixed: LPP-7437
Technical Reviewer: tucker
QA Reviewer: (pending)
Doc Reviewer: (pending)
Details:
Change some examples that used the debugger to use text instead.
Change examples and text using Debug.write() to use Debug.debug,
with a few
exceptions in the debugging chapter.
Add paragraph to the debugging chapter, section 4. Logging to the
Debugger,
recommending using Debug.format or one of its variants over
Debug.write(),
and linking to the Debug and lz.Formatter reference pages.
This task is now complete for the dguide; the reference manual still
needs
to be done.
Tests: visual verify; test live examples
Files:
M docs/src/developers/lzunit.dbk
M docs/src/developers/classes-powerprogramming.dbk
M docs/src/developers/components-design.dbk
M docs/src/developers/views.dbk
M docs/src/developers/performance.dbk
M docs/src/developers/rpc-soap.dbk
M docs/src/developers/rpc.dbk
M docs/src/developers/methods-events-attributes.dbk
M docs/src/developers/debugging.dbk
M docs/src/developers/data_app.dbk
M docs/src/developers/program-development.dbk
M docs/src/developers/browser-integration.dbk
M docs/src/developers/persistent_connection.dbk
M docs/src/developers/programs/rpc-soap-$10.lzx
M docs/src/developers/programs/rpc-$11.lzx
M docs/src/developers/programs/rpc-$15.lzx
M docs/src/developers/programs/rpc-$19.lzx
M docs/src/developers/programs/class-inheritance-$30.lzx
M docs/src/developers/programs/rpc-$20.lzx
M docs/src/developers/programs/program-development-$15.lzx
M docs/src/developers/programs/methods-events-attributes-$25.lzx
M docs/src/developers/programs/browser-integration-$19.lzx
M docs/src/developers/programs/class-inheritance-$4.lzx
M docs/src/developers/programs/class-inheritance-$8.lzx
M docs/src/developers/programs/databinding-$13.lzx
M docs/src/developers/programs/class-inheritance-$26.lzx
M docs/src/developers/programs/datapointer-creating-node.lzx
M docs/src/developers/programs/rpc-soap-$8.lzx
M docs/src/developers/programs/testdriven-9.lzx
M docs/src/developers/programs/rpc-$12.lzx
M docs/src/developers/programs/rpc-$16.lzx
M docs/src/developers/programs/class-inheritance-$31.lzx
M docs/src/developers/programs/rpc-$21.lzx
M docs/src/developers/programs/class-inheritance-$1.lzx
M docs/src/developers/programs/databinding-$7.lzx
M docs/src/developers/programs/databinding-$10.lzx
M docs/src/developers/programs/rpc-javarpc-$4.lzx
M docs/src/developers/programs/rpc-javarpc-$8.lzx
M docs/src/developers/programs/class-inheritance-$27.lzx
M docs/src/developers/programs/rpc-javarpc-$10.lzx
M docs/src/developers/programs/rpc-soap-$5.lzx
M docs/src/developers/programs/rpc-xmlrpc-$2.lzx
M docs/src/developers/programs/testdriven-6.lzx
M docs/src/developers/programs/performance-tuning-$1.lzx
M docs/src/developers/programs/rpc-$17.lzx
M docs/src/developers/programs/debugging-$4.lzx
M docs/src/developers/programs/canvasversion.lzx
M docs/src/developers/programs/lzunit-$5.lzx
M docs/src/developers/programs/class-inheritance-$6.lzx
M docs/src/developers/programs/databinding-$8.lzx
M docs/src/developers/programs/class-inheritance-$19.lzx
M docs/src/developers/programs/custom-components-$1.lzx
M docs/src/developers/programs/testdriven-10.lzx
M docs/src/developers/programs/datapointer-basics.lzx
M docs/src/developers/programs/class-inheritance-$20.lzx
M docs/src/developers/programs/rpc-soap-$2.lzx
M docs/src/developers/programs/testdriven-3.lzx
M docs/src/developers/programs/rpc-soap-$13.lzx
M docs/src/developers/programs/rpc-$14.lzx
M docs/src/developers/programs/methods-events-attributes-$11.lzx
M docs/src/developers/programs/debugging-$5.lzx
M docs/src/developers/programs/class-inheritance-$7.lzx
M docs/src/developers/programs/databinding-$9.lzx
M docs/src/developers/programs/layout-and-design-$19.lzx
M docs/src/developers/programs/browser-integration.setting-
defaults.lzx
M docs/src/developers/programs/databinding-$16.lzx
M docs/src/developers/programs/data-accessing-lzdataelement.lzx
M docs/src/developers/programs/rpc-javarpc-$2.lzx
M docs/src/developers/programs/class-inheritance-$21.lzx
M docs/src/developers/programs/class-inheritance-$29.lzx
M docs/src/developers/programs/rpc-soap-$3.lzx
M docs/src/developers/programs/testdriven-8.lzx
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20081211-lou-0.tar