gre.log
gre.log(
id,
format,
[args...]
)
Generate a log message that will be carried through the Storyboard engine logging system. This can be more effective than using standard Lua print statement because the output can be redirected to different outputs. In order to have gre.log() messages logged properly, the -olua,log option or the -omodel_mgr,plugin_log option needs to be set.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | #number | The verbosity level at which to log this message, See gre.LOG_ Constants. The output will be subjected to the verbosity logging filtering. |
format | #string | The string.format style format message |
[args...] | #string or #number or #boolean | Arguments to match the format (strings or numbers) |
Example
-- These values are defined in gre for use with gre.log
--gre.LOG_ALWAYS = -1, -- Always go to stdout
--gre.LOG_ERROR = 0, -- Errors (fatal and non-fatal)
--gre.LOG_WARNING = 1, -- Warnings
--gre.LOG_INFO = 2, -- Information, one time, non-repetitive
--gre.LOG_EVENT1 = 3 -- Event delivery, excluding motion/mtevent/redraws
--gre.LOG_ACTION = 4, -- Action execution
--gre.LOG_DIAG1 = 5, -- Storyboard diagnostic informative
--gre.LOG_DIAG2 = 6, -- Storyboard diagnostic detailed
--gre.LOG_EVENT2 = 7, -- Motion/mtevent/redraw event delivery
--gre.LOG_ACTION2 = 8 -- Motion/mtevent/redraw action execution
--gre.LOG_TRACE1 = 9, -- Storyboard minimal tracing
--gre.LOG_TRACE2 = 10 -- Storyboard maximum tracing
-- Generate an error message
gre.log(gre.LOG_ERROR, "This is an error message")
-- Generate an diagnostic information message
gre.log(gre.LOG_INFO, "This is an info message")
-- Generate an unfiltered message
gre.log(gre.LOG_ALWAYS, "This message will always be shown")