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
+2 -3
View File
@@ -371,7 +371,7 @@ export const graphql = {
wsHasDisconnected(websocketId); wsHasDisconnected(websocketId);
} }
}, },
context: ({req, connection, ...args_}, ...args__) => { context: ({ req, connection }) => {
// Normal Websocket connection // Normal Websocket connection
if (connection && Object.keys(connection.context).length >= 1) { if (connection && Object.keys(connection.context).length >= 1) {
// Check connection for metadata // Check connection for metadata
@@ -388,8 +388,7 @@ export const graphql = {
user user
}; };
} }
console.log({req, connection, args_, args__});
throw new Error('Invalid'); throw new Error('Invalid');
} }
}; };
+2 -2
View File
@@ -8,8 +8,8 @@ const log = console;
const { loadState } = utils; const { loadState } = utils;
const { varState } = states; const { varState } = states;
process.on('uncaughtException', console.log); process.on('uncaughtException', log.debug);
process.on('unhandledRejection', console.log); process.on('unhandledRejection', log.debug);
const internalWsAddress = () => { const internalWsAddress = () => {
const port = config.get('graphql-api-port'); const port = config.get('graphql-api-port');
+1 -1
View File
@@ -20,7 +20,7 @@ export const publish = (channel: string, mutation: string, node?: {}) => {
}; };
if (!canPublishToChannel(channel)) { if (!canPublishToChannel(channel)) {
// console.log(`can't post to ${channel}`); log.debug(`can't post to ${channel}`);
return; return;
} }
-2
View File
@@ -76,14 +76,12 @@ export const wsHasDisconnected = (id: string) => {
export const canPublishToChannel = (channel: string) => { export const canPublishToChannel = (channel: string) => {
// No ws connections // No ws connections
if (getWsConectionCount() === 0) { if (getWsConectionCount() === 0) {
// log.debug('No ws connections, cannot publish');
return false; return false;
} }
// No ws connections to this channel // No ws connections to this channel
const channelConnectionCount = getWsConectionCountInChannel(channel); const channelConnectionCount = getWsConectionCountInChannel(channel);
if (channelConnectionCount === 0) { if (channelConnectionCount === 0) {
// log.debug(`No connections to channel ${channel}`);
return false; return false;
} }