This repository has been archived by the owner on Dec 23, 2019. It is now read-only.
forked from seandunn/s2_extraction_pipeline
-
Notifications
You must be signed in to change notification settings - Fork 5
Logger
benoitmangili edited this page Jul 22, 2013
·
3 revisions
In UAT,
It might be useful to get some debugging info. By design, this is not directly accessible, as everything lives in the client.
To bypass this, an logging module has been added: Logger.
Its role is to capture the ajax calls, debug/warn/error calls, and to store locally this information. When the an error or an exception occurs, the logger will create an email, and fire it. This will open the user email client, and invite her/him to send the email containing the debug data.
One can add debugging statement in the code using:
define(['Logger'], function(Logger){
...
Logger.debug({message:"Just to make sure we went pass this point"});
...
Logger.warn({message:"Something weird happened, or at least, as special case that needs attention."});
...
Logger.error({ message: "Something wrong happened! We should stop here.",
details: {
// ...
// details that might be relevant for debugging
// ...
}
});
})
The amount of data logged can be set in the config file, using:
verboseLevel: "NONE", // DEBUG, WARNING, ERROR, NONE
withLoggingWindow: false,
It is initialised in the App:addEventHandlers() method.