Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
refactor: improve console messages
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossantos74 committed Jul 22, 2024
1 parent 02a0b3e commit e5082a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/lib/socket/connection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,16 @@ export class ClientConnection {
this.changeState(ClientState.DISCONNECTED, error.errorType);
}

const logMessage = `[SuperViz]
- Error: ${error.errorType}
- Message: ${error.message}
`;

if (error.level === 'error') {
console.error('[SuperViz - Error]', 'Type: ', error.errorType, 'Message :', error.message);
console.error(logMessage);
return;
}

console.warn('[SuperViz - Warning]', 'Type: ', error.errorType, 'Message :', error.message);
console.warn(logMessage);
};
}
2 changes: 0 additions & 2 deletions src/services/io/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export class IOC {
return;
}

console.log('[Superviz] Connection state:', state);

if (state.reason === 'user-already-in-room') {
this.state = state;
this.stateSubject.next(IOCState.SAME_ACCOUNT_ERROR);
Expand Down

0 comments on commit e5082a5

Please sign in to comment.