mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Add option to log every request start and end to loggly (#15243)
This commit is contained in:
@@ -59,7 +59,17 @@ export function generateReq (options = {}) {
|
||||
header (header) {
|
||||
return this.headers[header];
|
||||
},
|
||||
listeners: {},
|
||||
session: {},
|
||||
on (key, func) {
|
||||
if (!this.listeners[key]) {
|
||||
this.listeners[key] = [];
|
||||
}
|
||||
this.listeners[key].push(func);
|
||||
},
|
||||
end () {
|
||||
this.listeners.close.forEach(func => func());
|
||||
},
|
||||
};
|
||||
|
||||
const req = defaultsDeep(options, defaultReq);
|
||||
|
||||
Reference in New Issue
Block a user