feat(logging): replace console.* with centralized logger infrastructure (#16655)

* feat(logging): replace console.* with centralized logger infrastructure

* fix(logging): remove logger from size-constrained bundles
This commit is contained in:
srijan
2025-11-20 06:01:35 +05:30
committed by GitHub
parent 40c240c7ca
commit 048d12de24
4 changed files with 11 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import { setScreenshareMuted } from '../media/actions';
import { addLocalTrack, replaceLocalTrack } from './actions.any';
import { getLocalDesktopTrack, getTrackState } from './functions.native';
import logger from './logger';
export * from './actions.any';
@@ -63,6 +64,6 @@ async function _startScreenSharing(dispatch: IStore['dispatch'], state: IReduxSt
}, NOTIFICATION_TIMEOUT_TYPE.LONG));
}
} catch (error: any) {
console.log('ERROR creating screen-sharing stream ', error);
logger.error('Error creating screen-sharing stream', error);
}
}

View File

@@ -12,6 +12,7 @@ import Button from '../../../base/ui/components/web/Button';
import { BUTTON_TYPES } from '../../../base/ui/constants.any';
import { copyText } from '../../../base/util/copyText.web';
import { handleLobbyChatInitialized, openChat } from '../../actions.web';
import logger from '../../logger';
export interface IProps {
className?: string;
@@ -125,11 +126,11 @@ const MessageMenu = ({ message, participantId, isFromVisitor, isLobbyMessage, en
setShowCopiedMessage(false);
}, 2000);
} else {
console.error('Failed to copy text');
logger.error('Failed to copy text');
}
})
.catch(error => {
console.error('Error copying text:', error);
.catch((error: Error) => {
logger.error('Error copying text', error);
});
handleClose();
}, [ message ]);

View File

@@ -0,0 +1,3 @@
import { getLogger } from '../base/logging/functions';
export default getLogger('app:chat');

View File

@@ -11,6 +11,7 @@ import {
RESET_UNREAD_POLLS_COUNT,
SAVE_POLL
} from './actionTypes';
import logger from './logger';
import { IIncomingAnswerData, IPollData } from './types';
const INITIAL_STATE = {
@@ -87,7 +88,7 @@ ReducerRegistry.register<IPollsState>(STORE_NAME, (state = INITIAL_STATE, action
// if the poll doesn't exist
if (!(pollId in state.polls)) {
console.warn('requested poll does not exist: pollId ', pollId);
logger.warn('Requested poll does not exist', { pollId });
return state;
}