chore: remove console usage

This commit is contained in:
Alexis Tyler
2020-09-07 21:29:12 +09:30
parent 65e64c8990
commit f3bbddca13
4 changed files with 5 additions and 8 deletions

View File

@@ -371,7 +371,7 @@ export const graphql = {
wsHasDisconnected(websocketId);
}
},
context: ({req, connection, ...args_}, ...args__) => {
context: ({ req, connection }) => {
// Normal Websocket connection
if (connection && Object.keys(connection.context).length >= 1) {
// Check connection for metadata
@@ -388,8 +388,7 @@ export const graphql = {
user
};
}
console.log({req, connection, args_, args__});
throw new Error('Invalid');
}
};

View File

@@ -8,8 +8,8 @@ const log = console;
const { loadState } = utils;
const { varState } = states;
process.on('uncaughtException', console.log);
process.on('unhandledRejection', console.log);
process.on('uncaughtException', log.debug);
process.on('unhandledRejection', log.debug);
const internalWsAddress = () => {
const port = config.get('graphql-api-port');

View File

@@ -20,7 +20,7 @@ export const publish = (channel: string, mutation: string, node?: {}) => {
};
if (!canPublishToChannel(channel)) {
// console.log(`can't post to ${channel}`);
log.debug(`can't post to ${channel}`);
return;
}

View File

@@ -76,14 +76,12 @@ export const wsHasDisconnected = (id: string) => {
export const canPublishToChannel = (channel: string) => {
// No ws connections
if (getWsConectionCount() === 0) {
// log.debug('No ws connections, cannot publish');
return false;
}
// No ws connections to this channel
const channelConnectionCount = getWsConectionCountInChannel(channel);
if (channelConnectionCount === 0) {
// log.debug(`No connections to channel ${channel}`);
return false;
}