Skip to content

Commit

Permalink
Fix problems with logs (lynckia#1626)
Browse files Browse the repository at this point in the history
  • Loading branch information
lodoyun authored Sep 21, 2020
1 parent c77d6a2 commit 8d04d77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions erizo_controller/erizoClient/src/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,16 +759,16 @@ const Room = (altIo, altConnectionHelpers, altConnectionManager, specInput) => {
// It stablishes a connection to the room.
// Once it is done it throws a RoomEvent("room-connected")
that.connect = (options = {}) => {
const token = Base64.decodeBase64(spec.token);
const token = JSON.parse(Base64.decodeBase64(spec.token));

if (that.state !== DISCONNECTED) {
log.warning(`message: Room already connected, roomId: ${that.roomID}, ${toLog()}`);
}

// 1- Connect to Erizo-Controller
that.state = CONNECTING;
log.info(`message: Connecting to room, tokenId: ${token.tokenId}, ${toLog()}`);
socket.connect(JSON.parse(token), options, (response) => {
log.info(`message: Connecting to room, tokenId: ${token.tokenId}`);
socket.connect(token, options, (response) => {
let stream;
const streamList = [];
const streams = response.streams || [];
Expand Down
10 changes: 6 additions & 4 deletions erizo_controller/erizoClient/src/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ const Stream = (altConnectionHelpers, specInput) => {

that.toLog = () => {
let info = `streamId: ${that.getID()}, label: ${that.getLabel()}`;
const attrKeys = Object.keys(spec.attributes);
attrKeys.forEach((attrKey) => {
info = `${info}, ${attrKey}: ${spec.attributes[attrKey]}`;
});
if (spec.attributes) {
const attrKeys = Object.keys(spec.attributes);
attrKeys.forEach((attrKey) => {
info = `${info}, ${attrKey}: ${spec.attributes[attrKey]}`;
});
}
return info;
};

Expand Down

0 comments on commit 8d04d77

Please sign in to comment.