logging updates
This commit is contained in:
@@ -78,6 +78,7 @@ export function LivekitRoomAudioRenderer({
|
|||||||
.filter((ref) => {
|
.filter((ref) => {
|
||||||
const isValid = validIdentities.includes(ref.participant.identity);
|
const isValid = validIdentities.includes(ref.participant.identity);
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
|
// TODO make sure to also skip the warn logging for the local identity
|
||||||
// Log that there is an invalid identity, that means that someone is publishing audio that is not expected to be in the call.
|
// Log that there is an invalid identity, that means that someone is publishing audio that is not expected to be in the call.
|
||||||
prefixedLogger.warn(
|
prefixedLogger.warn(
|
||||||
`Audio track ${ref.participant.identity} from ${url} has no matching matrix call member`,
|
`Audio track ${ref.participant.identity} from ${url} has no matching matrix call member`,
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ export const DeveloperSettingsTab: FC<Props> = ({
|
|||||||
})}
|
})}
|
||||||
</h4>
|
</h4>
|
||||||
<p>LivekitAlias: {livekitRoom.livekitAlias}</p>
|
<p>LivekitAlias: {livekitRoom.livekitAlias}</p>
|
||||||
|
<p>connectionState (wont hot reload): {livekitRoom.room.state}</p>
|
||||||
{livekitRoom.isLocal && <p>ws-url: {localSfuUrl?.href}</p>}
|
{livekitRoom.isLocal && <p>ws-url: {localSfuUrl?.href}</p>}
|
||||||
<p>
|
<p>
|
||||||
{t("developer_mode.livekit_server_info")}(
|
{t("developer_mode.livekit_server_info")}(
|
||||||
|
|||||||
@@ -79,10 +79,20 @@ export class Publisher {
|
|||||||
|
|
||||||
this.workaroundRestartAudioInputTrackChrome(devices, scope);
|
this.workaroundRestartAudioInputTrackChrome(devices, scope);
|
||||||
this.scope.onEnd(() => {
|
this.scope.onEnd(() => {
|
||||||
this.logger.info("Scope ended -> stop publishing all tracks");
|
|
||||||
void this.stopPublishing();
|
|
||||||
muteStates.audio.unsetHandler();
|
muteStates.audio.unsetHandler();
|
||||||
muteStates.video.unsetHandler();
|
muteStates.video.unsetHandler();
|
||||||
|
this.logger.info(
|
||||||
|
"Scope ended -> unset handler + stop publishing all tracks",
|
||||||
|
);
|
||||||
|
|
||||||
|
const stopAllMedia = async () => {
|
||||||
|
logger.info("onEnd: start stopping all media");
|
||||||
|
await this.stopPublishing();
|
||||||
|
logger.info("onEnd: stopped publishing");
|
||||||
|
await this.stopTracks();
|
||||||
|
logger.info("onEnd: stopped tracks");
|
||||||
|
};
|
||||||
|
void stopAllMedia();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.connection.livekitRoom.localParticipant.on(
|
this.connection.livekitRoom.localParticipant.on(
|
||||||
|
|||||||
@@ -155,6 +155,16 @@ export class Connection {
|
|||||||
const { url, jwt, livekitAlias } =
|
const { url, jwt, livekitAlias } =
|
||||||
this.existingSFUConfig ??
|
this.existingSFUConfig ??
|
||||||
(await this.getSFUConfigForRemoteConnection());
|
(await this.getSFUConfigForRemoteConnection());
|
||||||
|
this.logger.debug(
|
||||||
|
"Starting Connection to: ",
|
||||||
|
this.transport.livekit_service_url,
|
||||||
|
"jwt: ",
|
||||||
|
jwt,
|
||||||
|
"wss: ",
|
||||||
|
url,
|
||||||
|
"livekitAlias: ",
|
||||||
|
livekitAlias,
|
||||||
|
);
|
||||||
this._livekitAlias = livekitAlias;
|
this._livekitAlias = livekitAlias;
|
||||||
// If we were stopped while fetching the config, don't proceed to connect
|
// If we were stopped while fetching the config, don't proceed to connect
|
||||||
if (this.stopped) return;
|
if (this.stopped) return;
|
||||||
@@ -171,8 +181,11 @@ export class Connection {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
this.logger.info(`livekitRoom.connect ${url}`);
|
||||||
await this.livekitRoom.connect(url, jwt);
|
await this.livekitRoom.connect(url, jwt);
|
||||||
|
this.logger.info(`livekitRoom.connect SUCCESS ${url}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
this.logger.info(`livekitRoom.connect FAILED ${url}`, e);
|
||||||
// LiveKit uses 503 to indicate that the server has hit its track limits.
|
// LiveKit uses 503 to indicate that the server has hit its track limits.
|
||||||
// https://github.com/livekit/livekit/blob/fcb05e97c5a31812ecf0ca6f7efa57c485cea9fb/pkg/service/rtcservice.go#L171
|
// https://github.com/livekit/livekit/blob/fcb05e97c5a31812ecf0ca6f7efa57c485cea9fb/pkg/service/rtcservice.go#L171
|
||||||
// It also errors with a status code of 200 (yes, really) for room
|
// It also errors with a status code of 200 (yes, really) for room
|
||||||
@@ -233,12 +246,15 @@ export class Connection {
|
|||||||
*/
|
*/
|
||||||
public async stop(): Promise<void> {
|
public async stop(): Promise<void> {
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
`Stopping connection to ${this.transport.livekit_service_url}`,
|
`stop: disconnecing from lk room ${this.transport.livekit_service_url}`,
|
||||||
);
|
);
|
||||||
if (this.stopped) return;
|
if (this.stopped) return;
|
||||||
await this.livekitRoom.disconnect();
|
await this.livekitRoom.disconnect();
|
||||||
this._state$.next(ConnectionState.Stopped);
|
this._state$.next(ConnectionState.Stopped);
|
||||||
this.stopped = true;
|
this.stopped = true;
|
||||||
|
this.logger.debug(
|
||||||
|
`stop: DONE disconnecing from lk room ${this.transport.livekit_service_url}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly client: OpenIDClientParts;
|
private readonly client: OpenIDClientParts;
|
||||||
@@ -255,9 +271,11 @@ export class Connection {
|
|||||||
public constructor(opts: ConnectionOpts, logger: Logger) {
|
public constructor(opts: ConnectionOpts, logger: Logger) {
|
||||||
this.ownMembershipIdentity = opts.ownMembershipIdentity;
|
this.ownMembershipIdentity = opts.ownMembershipIdentity;
|
||||||
this.existingSFUConfig = opts.existingSFUConfig;
|
this.existingSFUConfig = opts.existingSFUConfig;
|
||||||
this.logger = logger.getChild("[Connection]");
|
this.logger = logger.getChild(
|
||||||
|
"[Connection " + opts.transport.livekit_service_url + "]",
|
||||||
|
);
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`Creating new connection to ${opts.transport.livekit_service_url} ${opts.transport.livekit_alias}`,
|
`constructor: ${opts.transport.livekit_service_url} alias: ${opts.transport.livekit_alias} withSfuConfig?: ${sfuConfig})`,
|
||||||
);
|
);
|
||||||
const { transport, client, scope } = opts;
|
const { transport, client, scope } = opts;
|
||||||
|
|
||||||
|
|||||||
@@ -189,10 +189,6 @@ export function createConnectionManager$({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
(scope, _data$, serviceUrl, alias, sfuConfig) => {
|
(scope, _data$, serviceUrl, alias, sfuConfig) => {
|
||||||
logger.debug(
|
|
||||||
`Creating connection to ${serviceUrl} (${alias}, withSfuConfig (local connection?): ${JSON.stringify(sfuConfig) ?? "no config->remote connection"})`,
|
|
||||||
);
|
|
||||||
|
|
||||||
const connection = connectionFactory.createConnection(
|
const connection = connectionFactory.createConnection(
|
||||||
scope,
|
scope,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user