mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
fix(logging-config): Improve types
This commit is contained in:
@@ -1845,9 +1845,10 @@ var config = {
|
||||
// //disableLogCollector: true,
|
||||
// // Individual loggers are customizable.
|
||||
// loggers: {
|
||||
// // The following are too verbose in their logging with the default level.
|
||||
// 'modules/RTC/TraceablePeerConnection.js': 'info',
|
||||
// 'modules/xmpp/strophe.util.js': 'log',
|
||||
// // The following are too verbose in their logging with the default level.
|
||||
// 'modules/RTC/TraceablePeerConnection.js': 'info',
|
||||
// 'modules/xmpp/strophe.util.js': 'log',
|
||||
// },
|
||||
// },
|
||||
|
||||
// Application logo url
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ToolbarButton } from '../../toolbox/types';
|
||||
import { ILoggingConfig } from '../logging/types';
|
||||
|
||||
type ButtonsWithNotifyClick = 'camera' |
|
||||
'chat' |
|
||||
@@ -468,6 +469,7 @@ export interface IConfig {
|
||||
};
|
||||
localSubject?: string;
|
||||
locationURL?: URL;
|
||||
logging?: ILoggingConfig;
|
||||
mainToolbarButtons?: Array<Array<string>>;
|
||||
maxFullResolutionParticipants?: number;
|
||||
microsoftApiApplicationClientID?: string;
|
||||
|
||||
@@ -5,10 +5,11 @@ import ReducerRegistry from '../redux/ReducerRegistry';
|
||||
import { equals, set } from '../redux/functions';
|
||||
|
||||
import { SET_LOGGING_CONFIG, SET_LOG_COLLECTOR } from './actionTypes';
|
||||
import { ILoggingConfig, LogLevel } from './types';
|
||||
|
||||
const DEFAULT_LOGGING_CONFIG = {
|
||||
const DEFAULT_LOGGING_CONFIG: ILoggingConfig = {
|
||||
// default log level for the app and lib-jitsi-meet
|
||||
defaultLogLevel: 'trace' as LogLevel,
|
||||
defaultLogLevel: 'trace',
|
||||
|
||||
// Option to disable LogCollector (which stores the logs)
|
||||
// disableLogCollector: true,
|
||||
@@ -16,8 +17,8 @@ const DEFAULT_LOGGING_CONFIG = {
|
||||
loggers: {
|
||||
// The following are too verbose in their logging with the
|
||||
// {@link #defaultLogLevel}:
|
||||
'modules/RTC/TraceablePeerConnection.js': 'info' as LogLevel,
|
||||
'modules/xmpp/strophe.util.js': 'log' as LogLevel
|
||||
'modules/RTC/TraceablePeerConnection.js': 'info',
|
||||
'modules/xmpp/strophe.util.js': 'log'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,11 +40,11 @@ const DEFAULT_STATE = {
|
||||
|
||||
// Reduce default verbosity on mobile, it kills performance.
|
||||
if (navigator.product === 'ReactNative') {
|
||||
const RN_LOGGERS = {
|
||||
'modules/sdp/SDPUtil.js': 'info' as LogLevel,
|
||||
'modules/xmpp/ChatRoom.js': 'warn' as LogLevel,
|
||||
'modules/xmpp/JingleSessionPC.js': 'info' as LogLevel,
|
||||
'modules/xmpp/strophe.jingle.js': 'info' as LogLevel
|
||||
const RN_LOGGERS: { [key: string]: LogLevel; } = {
|
||||
'modules/sdp/SDPUtil.js': 'info',
|
||||
'modules/xmpp/ChatRoom.js': 'warn',
|
||||
'modules/xmpp/JingleSessionPC.js': 'info',
|
||||
'modules/xmpp/strophe.jingle.js': 'info'
|
||||
};
|
||||
|
||||
DEFAULT_STATE.config.loggers = {
|
||||
@@ -52,16 +53,8 @@ if (navigator.product === 'ReactNative') {
|
||||
};
|
||||
}
|
||||
|
||||
type LogLevel = 'trace' | 'log' | 'info' | 'warn' | 'error';
|
||||
|
||||
export interface ILoggingState {
|
||||
config: {
|
||||
defaultLogLevel: LogLevel;
|
||||
disableLogCollector?: boolean;
|
||||
loggers: {
|
||||
[key: string]: LogLevel;
|
||||
};
|
||||
};
|
||||
config: ILoggingConfig;
|
||||
logCollector?: {
|
||||
flush: () => void;
|
||||
start: () => void;
|
||||
|
||||
9
react/features/base/logging/types.ts
Normal file
9
react/features/base/logging/types.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export type LogLevel = 'trace' | 'log' | 'info' | 'warn' | 'error';
|
||||
|
||||
export interface ILoggingConfig {
|
||||
defaultLogLevel?: LogLevel;
|
||||
disableLogCollector?: boolean;
|
||||
loggers?: {
|
||||
[key: string]: LogLevel;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user