Class Hermes
Hermes
Defined in: Hermes.js.
Constructor Attributes | Constructor Name and Description |
---|---|
<private> |
Hermes(oLevel, nImmediate, nTimeout)
Hermes is the class that manages Appenders, Error, Deferred calls and Levels of Error to show
We can add Errors but if the Error is not of the same level the error will not be showed.
|
Field Attributes | Field Name and Description |
---|---|
aErrors is the array that will contain the Errors
|
|
<static> |
Hermes.DEFERRED
|
<static> |
Hermes.IMMEDIATE
|
nImmediate is the config number to defer or not the append of logs
|
|
nTimeLastSent is the number of milliseconds of the last sent
now date by default
|
|
nTimeout is the number of milliseconds to defer the append of logs
|
|
oAppenders is the object that will contain the Appenders to append messages
|
|
oLevel is the Level instance to manage the Error Level to show.
|
Method Attributes | Method Name and Description |
---|---|
addAppender(oAppender)
addAppender add a new Appender to Hermes.
|
|
addError(oError)
addError check if oError is instance of ErrorExt and if it's the error is added and the notifyAppenders is called
notifyAppenders is executed to defer or log the message.
|
|
clear()
clear is the method that will clear messages
|
|
deferLog()
deferLog change the method to append logs to be deferred
|
|
forceLog()
forceLog will log messages even if the method of log is Deferred.
|
|
immediateLog change the method to append logs to be immediate
|
|
isImmediate checks if nImmediate is equals to Hermes.IMMEDIATE
|
|
isSameLevel(oError)
isSameLevel checks if the Error Level is the same that in oError
The method returns true if Level is ALL to allow log all the logs
The method returns false if Level is OFF to avoid log any log
|
|
isTimeToSent checks if now is time to sent new logs to the appender
|
|
log()
log is the method that will log messages
|
|
nextTimeToSent returns the time to know, if the method of log is Deferred, if it's possible to log messages.
|
|
notifyAppenders(sAction)
notifyAppenders send the message log for all the Appenders if the execution is Deferred and is time to send new logs or if the execution is Immediate.
|
|
now()
now returns the number of milliseconds at the moment of the execution of this method
|
|
removeAppender(oAppender)
removeAppender removes the Appender.
|
|
resetErrors clean all the erros in the aErrors Array
|
|
sendMessage(oAppender, sAction)
sendMessage executes the action in Appender for each Error.
|
|
setAppenders(aAppenders)
setAppenders add an array of Appenders to be added in one step.
|
|
setLevel(oLevel)
setLevel set a new Level for the Hermes
Before change the level it's checked if oLevel is instance of Level to be assigned or not.
|
Class Detail
<private>
Hermes(oLevel, nImmediate, nTimeout)
Hermes is the class that manages Appenders, Error, Deferred calls and Levels of Error to show
We can add Errors but if the Error is not of the same level the error will not be showed.
If the Hermes Error Level is ALL all the logs will be added
If the Hermes Error Level is OFF no log will be added
The add of logs can be deferred to avoid multiple calls that block browser
- Parameters:
- oLevel
- nImmediate
- nTimeout
Field Detail
aErrors
aErrors is the array that will contain the Errors
<static>
Hermes.DEFERRED
<static>
Hermes.IMMEDIATE
nImmediate
nImmediate is the config number to defer or not the append of logs
nTimeLastSent
nTimeLastSent is the number of milliseconds of the last sent
now date by default
nTimeout
nTimeout is the number of milliseconds to defer the append of logs
oAppenders
oAppenders is the object that will contain the Appenders to append messages
oLevel
oLevel is the Level instance to manage the Error Level to show.
Method Detail
addAppender(oAppender)
addAppender add a new Appender to Hermes. When the Appender is added starts to log messages
Before add a new Appender it's checked if oAppender is instance of Appender to be added or not.
- Parameters:
- oAppender
- Returns:
- Hermes instance
addError(oError)
addError check if oError is instance of ErrorExt and if it's the error is added and the notifyAppenders is called
notifyAppenders is executed to defer or log the message.
- Parameters:
- oError
- Returns:
- Hermes instance
clear()
clear is the method that will clear messages
deferLog()
deferLog change the method to append logs to be deferred
- Returns:
- Hermes instance
forceLog()
forceLog will log messages even if the method of log is Deferred.
- Returns:
- Hermes instance
immediateLog()
immediateLog change the method to append logs to be immediate
- Returns:
- Hermes instance
{Boolean}
isImmediate()
isImmediate checks if nImmediate is equals to Hermes.IMMEDIATE
- Returns:
- {Boolean}
isSameLevel(oError)
isSameLevel checks if the Error Level is the same that in oError
The method returns true if Level is ALL to allow log all the logs
The method returns false if Level is OFF to avoid log any log
- Parameters:
- oError
- Returns:
- {Boolean}
{Boolean}
isTimeToSent()
isTimeToSent checks if now is time to sent new logs to the appender
- Returns:
- {Boolean}
log()
log is the method that will log messages
{Number}
nextTimeToSent()
nextTimeToSent returns the time to know, if the method of log is Deferred, if it's possible to log messages.
- Returns:
- {Number}
notifyAppenders(sAction)
notifyAppenders send the message log for all the Appenders if the execution is Deferred and is time to send new logs or if the execution is Immediate.
after execute notifyAppenders the errors are reset to allow new Errors to log.
- Parameters:
- sAction
- Returns:
- Hermes instance
{Number}
now()
now returns the number of milliseconds at the moment of the execution of this method
- Returns:
- {Number} Milliseconds
removeAppender(oAppender)
removeAppender removes the Appender. When the Appender is removed stops to log messages
- Parameters:
- oAppender
- Returns:
- Hermes instance
resetErrors()
resetErrors clean all the erros in the aErrors Array
sendMessage(oAppender, sAction)
sendMessage executes the action in Appender for each Error.
- Parameters:
- oAppender
- sAction
setAppenders(aAppenders)
setAppenders add an array of Appenders to be added in one step.
- Parameters:
- aAppenders
- Returns:
- Hermes instance
setLevel(oLevel)
setLevel set a new Level for the Hermes
Before change the level it's checked if oLevel is instance of Level to be assigned or not.
- Parameters:
- oLevel
- Returns:
- Hermes instance