mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
chore: eslint prefer-rest-params, prefer-spread
This commit is contained in:
committed by
Julian Lam
parent
23f212a4c0
commit
115d19e289
@@ -191,13 +191,13 @@ Logger.io_one = function (socket, uid) {
|
||||
* This function replaces a socket's .emit/.on functions in order to intercept events
|
||||
*/
|
||||
function override(method, name, errorMsg) {
|
||||
return function () {
|
||||
return (...args) => {
|
||||
if (opts.streams.log.f) {
|
||||
opts.streams.log.f.write(Logger.prepare_io_string(name, uid, arguments));
|
||||
opts.streams.log.f.write(Logger.prepare_io_string(name, uid, args));
|
||||
}
|
||||
|
||||
try {
|
||||
method.apply(socket, arguments);
|
||||
method.apply(socket, args);
|
||||
} catch (err) {
|
||||
winston.info(errorMsg, err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user