---++!! !DebugLib %TOC{title="Contents:"}% %STARTINCLUDE% ---++ debug funcions in commonlib | *Title* | debug funcions in commonlib | | *Author(s)* | LiXizhi | | *Date* | 2006/11/25 | | *File* | script/ide/debug.lua | ---+++ Description debug related functions in commonlib %T% __Sample Code__ <verbatim> NPL.load("(gl)script/ide/commonlib.lua"); -- include commonlib to use this lib NPL.load("(gl)script/ide/debug.lua"); </verbatim> ---+++ Member Functions ---++++ !commonlib.DumpWSResult dump webservice result to log file, it will dump str (if not nil) followed by the msg struct content. * _param_ __str__ : nil or any name __syntax__ <verbatim>function commonlib.DumpWSResult(str)</verbatim> __parameters__ | *str* | nil or any name | ---++++ !commonlib.ShowDebugString show debug string using a UI control on the left top of the screen. call this function with multiple keys will display string in separate lines. * _param_ __keyname__ : key name * _param_ __str__ : string to display __syntax__ <verbatim>function commonlib.ShowDebugString(keyname, str)</verbatim> __parameters__ | *keyname* | key name | | *str* | | ---++++ !commonlib.debugstack [[ * _param_ __start__ : Number - the stack depth at which to start the stack trace (default 1 - the function calling debugstack) * _param_ __count1__ : Number - the number of functions to output at the top of the stack (default 12) * _param_ __count2__ : Number - the number of functions to output at the bottom of the stack (default 10) * _return_ __String__ : - a multi-line string showing what the current call stack looks like If there are more than count1+count2 calls in the stack, they are separated by a "..." line. e.g. local stack = commonlib.debugstack() ]] __syntax__ <verbatim>function commonlib.debugstack(level, count1, count2)</verbatim> __parameters__ | *level* | | | *count1* | | | *count2* | Number - the number of functions to output at the bottom of the stack (default 10) | ---++++ !commonlib.warning e.g. commonlib.error(table,"error:%d", no) in most case, one can assign this function to be a member of a certain table. __syntax__ <verbatim>function commonlib.warning(self, message, ...)</verbatim> __parameters__ | *self* | | | *message* | | ---++++ !commonlib.error e.g. commonlib.error(table,"error:%d", no) in most case, one can assign this function to be a member of a certain table. __syntax__ <verbatim>function commonlib.error(self, message, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)</verbatim> __parameters__ | *self* | | | *message* | | | *a1* | | | *a2* | | | *a3* | | | *a4* | | | *a5* | | | *a6* | | | *a7* | | | *a8* | | | *a9* | | | *a10* | | | *a11* | | | *a12* | | | *a13* | | | *a14* | | | *a15* | | | *a16* | | | *a17* | | | *a18* | | | *a19* | | | *a20* | | ---++++ !commonlib.assert e.g. commonlib.assert(table, cond==1, "error:%d", no) in most case, one can assign this function to be a member of a certain table. __syntax__ <verbatim>function commonlib.assert(self, condition, message, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)</verbatim> __parameters__ | *self* | | | *condition* | | | *message* | | | *a1* | | | *a2* | | | *a3* | | | *a4* | | | *a5* | | | *a6* | | | *a7* | | | *a8* | | | *a9* | | | *a10* | | | *a11* | | | *a12* | | | *a13* | | | *a14* | | | *a15* | | | *a16* | | | *a17* | | | *a18* | | | *a19* | | | *a20* | | %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback