Skip to content

Commit

Permalink
Chore: Remove Unnecessary Logs (RocketChat#1118)
Browse files Browse the repository at this point in the history
* Remove Unnecessary Logs

* Fix dummyLogger

* Fix dummyLogger

* Fix meteor method roles/get
  • Loading branch information
Shailesh351 authored Mar 16, 2022
1 parent 32bf2d5 commit 8f76e8f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app/models/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Base } from './models/_Base';
import { BaseDb } from './models/_BaseDb';
import Messages from './models/Messages';
import Rooms from './models/Rooms';
import { Roles } from './raw';
import Settings from './models/Settings';
import Subscriptions from './models/Subscriptions';
import Users from './models/Users';
Expand All @@ -28,6 +29,7 @@ export {
BaseDb,
Messages,
Rooms,
Roles,
Settings,
Subscriptions,
Users,
Expand Down
23 changes: 19 additions & 4 deletions ee/app/livechat-enterprise/server/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@ import { Logger } from '../../../../../app/logger/server';

export const logger = new Logger('LivechatEnterprise');

export const queriesLogger = logger.section('Queries');
export const queueLogger = logger.section('Queue');
export const helperLogger = logger.section('Helper');
export const cbLogger = logger.section('Callbacks');
// WIDECHAT
const dummyLogger = {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
debug: (..._args: any[]): void => {
// We don't need to log this because it spams elastic search with too many unnecessary logs
},
};

export const queriesLogger = dummyLogger;
export const queueLogger = dummyLogger;
export const helperLogger = dummyLogger;
export const cbLogger = dummyLogger;
export const bhLogger = dummyLogger;

// export const queriesLogger = logger.section('Queries');
// export const queueLogger = logger.section('Queue');
// export const helperLogger = logger.section('Helper');
// export const cbLogger = logger.section('Callbacks');
// export const bhLogger = logger.section('Business-Hours');
4 changes: 2 additions & 2 deletions server/publications/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Meteor } from 'meteor/meteor';
import { Roles } from '../../app/models';

Meteor.methods({
'roles/get'() {
async 'roles/get'() {
if (!Meteor.userId()) {
return [];
}

const records = Roles.find().fetch();
const records = await Roles.find().toArray();

return records;
},
Expand Down

0 comments on commit 8f76e8f

Please sign in to comment.