Difference between revisions of "Slverbosity"

From OpenEUO
Jump to: navigation, search
m (Created page with "== Calling Convention == Call local o = sl.verbosity([flags]) Args flags is a string, valid values: 'off', 'lo', 'med', 'hi' Results o is a string, the old value of flags ==...")
 
m (Calling Convention)
Line 1: Line 1:
 
== Calling Convention ==
 
== Calling Convention ==
 
Call
 
Call
  local o = sl.verbosity([flags])
+
  local o = sl.slverbosity([flags])
 
Args
 
Args
 
  flags is a string, valid values: 'off', 'lo', 'med', 'hi'
 
  flags is a string, valid values: 'off', 'lo', 'med', 'hi'

Revision as of 18:40, 1 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.verbosity('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. Valid flags:

flag  : effect
'off'   turn error recording 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

Additionally, if error reporting is set to 'hi' and errors are logged 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.

See Also