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.

Parameters: id An integer value that matches the enumeration in >gre/gre.h< to prefix the log message with a code, or -1 to simply output the message. If non-negative value is used, then the output will be subjected to the verbosity logging filtering. msg The message to output to the logging system.

Returns: 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_TRACE1  = 8,   -- Storyboard minimal tracing
--gre.LOG_TRACE2  = 9    -- 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")
Was this article helpful?
0 out of 0 found this helpful