EvanLoggingService¶
| Source | logging |
|---|
Helper to handle BCC log logging reports. The frontend is configured to cache each log that was submitted from everywhere. As a result of this, this service can handle this logs and can create reports for developers for error analysis.
log¶
loggingService.log(message, level);
Using BCC log function to handle a generalized logging mechanism.
Parameters¶
message-string: log messagelevel-string: log level as string, defaults to ‘info’
Returns¶
Promise returns void: resolved when done
Example¶
loggingService.log('test', 'error');
getLogsIncludingQueue¶
loggingService.getLogsIncludingQueue();
Return all logLog including the queue logs
Returns¶
Array<any>: logs including queue
Example¶
loggingService.getLogsIncludingQueue();
// => { "timestamp": 1529064180496, "level": "notice", "message": "cool message" }
buildLogObject¶
loggingService.buildLogObject(logs);
enhance log message with user information
Parameters¶
logs-Array<any>: logs to use
Returns¶
Array<any>: log object
getReportLogs¶
loggingService.getReportLogs(types);
Choose type all for current filtered log. Choose errors for only errors.
Parameters¶
type-string: all | errors
Returns¶
Array<any>: specific logs for type
logQuestionAlert¶
loggingService.logQuestionAlert();
Opens an alert to ask the user to log only errors with on click or with loggin dapp.
Returns¶
Promise returns any: resolved when clicked
sendLogs¶
loggingService.sendLogs(types);
Send log object to loggly.
Parameters¶
type-string(optional): ‘all’ (send current filtered logs) | ‘errors’ (send only errors)
copy¶
loggingService.copy(types);
Start copying of the error log. Choose type all for current filtered log. Choose errors for only errors.
Parameters¶
type-string(optional): ‘all’ (copy current filtered logs) | ‘errors’ (copy only errors)
Returns¶
Promise returns void: resolved when done
Example¶
loggingService.copy('errors');