_createNewCategory
private
void
_createNewCategory
(
sCategory
)
Creates a new category of log messages and fires categoryCreateEvent.
- Parameters:
-
sCategory <String>
Category name.
- Returns:
void
_createNewSource
private
void
_createNewSource
(
sSource
)
Creates a new source of log messages and fires sourceCreateEvent.
- Parameters:
-
sSource <String>
Source name.
- Returns:
void
_isNewCategory
private
Boolean
_isNewCategory
(
sCategory
)
Checks to see if a category has already been created.
- Parameters:
-
sCategory <String>
Category name.
- Returns:
Boolean
- Returns true if category is unknown, else returns false.
_isNewSource
private
Boolean
_isNewSource
(
sSource
)
Checks to see if a source already exists.
- Parameters:
-
sSource <String>
Source name.
- Returns:
Boolean
- Returns true if source is unknown, else returns false.
_onWindowError
private
void
_onWindowError
(
sMsg
,
sUrl
,
sLine
)
Handles logging of messages due to window error events.
- Parameters:
-
sMsg <String>
The error message. -
sUrl <String>
URL of the error. -
sLine <String>
Line number of the error.
- Returns:
void
_printToBrowserConsole
private
void
_printToBrowserConsole
(
oEntry
)
Outputs a log message to global console.log() function.
- Parameters:
-
oEntry <Object>
Log entry object.
- Returns:
void
disableBrowserConsole
void
disableBrowserConsole
(
)
Disables output to the browser's global console.log() function, which is used
by the Firebug extension to Firefox as well as Safari.
- Returns:
void
enableBrowserConsole
void
enableBrowserConsole
(
)
Enables output to the browser's global console.log() function, which is used
by the Firebug extension to Firefox as well as Safari.
- Returns:
void
getStack
Object[]
getStack
(
)
Public accessor to internal stack of log message objects.
- Returns:
Object[]
- Array of log message objects.
getStartTime
Date
getStartTime
(
)
Public accessor to internal start time.
- Returns:
Date
- Internal date of when Logger singleton was initialized.
log
void
log
(
sMsg
,
sCategory
,
sSource
)
Saves a log message to the stack and fires newLogEvent. If the log message is
assigned to an unknown category, creates a new category. If the log message is
from an unknown source, creates a new source. If browser console is enabled,
outputs the log message to browser console.
- Parameters:
-
sMsg <String>
The log message. -
sCategory <String>
Category of log message, or null. -
sSource <String>
Source of LogWriter, or null if global.
- Returns:
void
reset
void
reset
(
)
Resets internal stack and startTime, enables Logger, and fires logResetEvent.
- Returns:
void