mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ]);
|
||||
|
||||
3
react/features/chat/logger.ts
Normal file
3
react/features/chat/logger.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { getLogger } from '../base/logging/functions';
|
||||
|
||||
export default getLogger('app:chat');
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user