Difference between revisions of "Slverbosity"
From OpenEUO
m (→Description) |
m (→Usage Example) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
print(o) | print(o) | ||
− | --> | + | --> med |
== Description == | == Description == | ||
Line 19: | Line 19: | ||
flag : effect | flag : effect | ||
− | 'off' | + | 'off' Turn error reporting completely off. |
− | 'lo' | + | 'lo' Errors sent to file only, if redirection so allows. |
− | 'med' | + | 'med' Errors sent to file and or output window. |
− | 'hi' | + | 'hi' Library will raise unhandled exception upon any error, |
+ | stack trace added to error message if logged to file. | ||
Additionally, if error reporting is set to 'hi' and errors are redirected to file, then a stack trace will be added to the logged error message. | Additionally, if error reporting is set to 'hi' and errors are redirected to file, then a stack trace will be added to the logged error message. | ||
Line 30: | Line 31: | ||
== See Also == | == See Also == | ||
+ | |||
+ | * [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib] | ||
* [[slredirect]] | * [[slredirect]] | ||
* [[try]] | * [[try]] |
Latest revision as of 15:48, 2 November 2010
Calling Convention
Call
local o = sl.slverbosity([flags])
Args
flags is a string, valid values: 'off', 'lo', 'med', 'hi'
Results
o is a string, the old value of flags
Usage Example
local sl = dofile(getinstalldir()..'/lib/simplelib.lua') local o = sl.slverbosity('hi') print(o)
--> med
Description
Set the error and warning reporting verbosity level of the library if a flag argument is specified, and returns the old flags value regardless. Library initializes to 'med' verbosity. Valid flags:
flag : effect 'off' Turn error reporting completely off. 'lo' Errors sent to file only, if redirection so allows. 'med' Errors sent to file and or output window. 'hi' Library will raise unhandled exception upon any error, stack trace added to error message if logged to file.
Additionally, if error reporting is set to 'hi' and errors are redirected to file, then a stack trace will be added to the logged error message.
Upon Error
Called with wrong arguments, slverbosity records the error and fails silently.