Log

Overview | File | Class | Tree | Index | Help

Zapatec Utils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class Log

    Object
       |
       +--Log

class Log

The main Log class. Create a new instance of this class to send all logging events.
Defined in log4js.js

Field Summary
`<static> Object` | `DEBUG`
`<static> Object` | `ERROR`
`<static> Object` | `FATAL`
`<static> Object` | `INFO`
`<static> Object` | `NONE`
`<static> Object` | `WARN`

Constructor Summary
`Log(level,logger,prefix)` Create a new logger

Method Summary
`void` | `debug(s)` Log an event with priority of "debug"
`void` | `error(s)` Log an event with priority of "error"
`void` | `fatal(s)` Log an event with priority of "fatal"
`Object` | `getLevel()` Gets the current threshold priority level
`Object` | `getLogger()` Gets the current event logger function
`Object` | `getPrefix()` Gets the current prefix
`void` | `info(s)` Log an event with priority of "info"
`void` | `json(s)`
`void` | `setLevel(level)` Sets the current threshold log level for this Log instance.
`void` | `setLogger(logger)` Sets the current logger function
`void` | `setPrefix(pre)` Sets the current logger prefix
`void` | `warn(s)` Log an event with priority of "warn"
`<static> void` | `alertLogger(<String> msg,level)` Static alert logger method.
`<static> void` | `consoleLogger(<String> msg,level,<Log> obj)` Static Safari WebKit console logger method.
`<static> String` | `dumpObject(obj,indent)` This method is a utility function that takes an object and creates a string representation of it's members.
`<static> void` | `popupLogger(<String> msg,level,<Log> obj)` Static popup logger method.
`<static> void` | `writeLogger(<String> msg,level)` Static write logger method.
`<static> Object` | `zpdumpObject(obj, name, configIn)`
`<static> Object` | `zpdumpObject_config(objArgs)` This method will set the properties for the zpdumpObject config

Field Detail

### DEBUG

    <static> Object DEBUG

### ERROR

    <static> Object ERROR

### FATAL

    <static> Object FATAL

### INFO

    <static> Object INFO

### NONE

    <static> Object NONE

### WARN

    <static> Object WARN

Constructor Detail

### Log

    Log(level,logger,prefix)

Create a new logger

Parameters:

`level` - The cut-off logger level. You can adjust this level in the constructor and leave all other logging events in place. Defaults to Log.WARN.

`logger` - The logger to use. The logger is a function that accepts the logging events and informs the user or developer. Defaults to Log.writeLogger().

Method Detail

### debug

    void debug(s)

Log an event with priority of "debug"

Parameters:

`s` - the log message

### error

    void error(s)

Log an event with priority of "error"

Parameters:

`s` - the log message

### fatal

    void fatal(s)

Log an event with priority of "fatal"

Parameters:

`s` - the log message

### getLevel

    Object getLevel()

Gets the current threshold priority level

Returns:

current level

### getLogger

    Object getLogger()

Gets the current event logger function

Returns:

current logger

### getPrefix

    Object getPrefix()

Gets the current prefix

Returns:

current prefix

### info

    void info(s)

Log an event with priority of "info"

Parameters:

`s` - the log message

### json

    void json(s)

### setLevel

    void setLevel(level)

Sets the current threshold log level for this Log instance. Only events that have a priority of this level or greater are logged.

Parameters:

`level` - The new threshold priority level for logging events. This can be one of the static members Log.DEBUG, Log.INFO, Log.WARN, Log.ERROR, Log.FATAL, Log.NONE, or it can be one of the strings ["debug", "info", "warn", "error", "fatal", "none"].

### setLogger

    void setLogger(logger)

Sets the current logger function

Parameters:

`logger` - The function that will be called when a log event needs to be displayed

### setPrefix

    void setPrefix(pre)

Sets the current logger prefix

Parameters:

`prefix` - This prefix will be prepended to all messages.

### warn

    void warn(s)

Log an event with priority of "warn"

Parameters:

`s` - the log message

### alertLogger

    <static> void alertLogger(<String> msg,level)

Static alert logger method. This logger will display a javascript alert (messagebox) with the message.

Parameters:

`msg` - The message to display

`level` - The priority level of this log event

### consoleLogger

    <static> void consoleLogger(<String> msg,level,<Log> obj)

Static Safari WebKit console logger method. This logger will write messages to the Safari javascript console, if available. If this browser doesn't have a javascript console (IE/Moz), then it degrades gracefully to Log.popupLogger()

Parameters:

`msg` - The message to display

`level` - The priority level of this log event

`obj` - The originating Log object.

### dumpObject

    <static> String dumpObject(obj,indent)

This method is a utility function that takes an object and creates a string representation of it's members.

Parameters:

`the` - Object that you'd like to see

Returns:

a String representation of the object passed

### popupLogger

    <static> void popupLogger(<String> msg,level,<Log> obj)

Static popup logger method. This logger will popup a new window (if necessary), and add the log message to the top of a list.

Parameters:

`msg` - The message to display

`level` - The priority level of this log event

`obj` - The originating Log object.

### writeLogger

    <static> void writeLogger(<String> msg,level)

Static write logger method. This logger will print the message out to the web page using document.writeln.

Parameters:

`msg` - The message to display

`level` - The priority level of this log event

### zpdumpObject

    <static> Object zpdumpObject(obj, name, configIn)

### zpdumpObject_config

    <static> Object zpdumpObject_config(objArgs)

This method will set the properties for the zpdumpObject config

Parameters:

`the` - Object to tune the dump of an object

Overview | File | Class | Tree | Index | Help

Zapatec Utils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Aug 16 12:18:39 2007