IgeClass

Method: log

Provides logging capabilities to all IgeClass instances.
log (String text, String type, Object obj)
  • Stringtext The text to log.
  • Stringtype The type of log to output, can be 'log', 'info', 'warning' or 'error'.
  • Objectobj An optional object that will be output before the log text is output.

Log a message

var entity = new IgeEntity();

// Will output:
//   IGE *log* [IgeEntity] : hello
entity.log('Hello');

Log an info message with an optional parameter

var entity = new IgeEntity(),
    param = 'moo';

// Will output:
//  moo
//  IGE *log* [IgeEntity] : hello
entity.log('Hello', 'info', param);

Log a warning message (which will cause a stack trace to be shown)

var entity = new IgeEntity();

// Will output (stack trace is just an example here, real one will be more useful):
//  Stack: {anonymous}()@<anonymous>:2:8
//  ---- Object.InjectedScript._evaluateOn (<anonymous>:444:39)
//  ---- Object.InjectedScript._evaluateAndWrap (<anonymous>:403:52)
//  ---- Object.InjectedScript.evaluate (<anonymous>:339:21)
//  IGE *warning* [IgeEntity] : A test warning
entity.log('A test warning', 'warning');

Log an error message (which will cause an exception to be raised and a stack trace to be shown)

var entity = new IgeEntity();

// Will output (stack trace is just an example here, real one will be more useful):
//  Stack: {anonymous}()@<anonymous>:2:8
//  ---- Object.InjectedScript._evaluateOn (<anonymous>:444:39)
//  ---- Object.InjectedScript._evaluateAndWrap (<anonymous>:403:52)
//  ---- Object.InjectedScript.evaluate (<anonymous>:339:21)
//  IGE *error* [IgeEntity] : An error message
entity.log('An error message', 'error');
© Copyright 2013 Irrelon Software Limited. All Rights Reserved. UK Registered Company Number: 07522767
Isogenic (ī´sōjen´ik): Adj originating from a common source; possessing the same genetic composition.
Strange Things Happen at the One Two Point