[mirotalksfu] - logs refactoring
هذا الالتزام موجود في:
@@ -44,7 +44,7 @@ function fixDurationOrRemux(inputPath, durationMs) {
|
||||
|
||||
if (hasFfmpeg() && (isWebm || isMp4)) {
|
||||
const ok = remuxWithFfmpeg(inputPath, isMp4 ? 'mp4' : 'webm');
|
||||
log.info('ffmpeg detected remuxWithFfmpeg:', ok);
|
||||
log.debug('ffmpeg detected remuxWithFfmpeg:', ok);
|
||||
if (ok) return true;
|
||||
}
|
||||
|
||||
@@ -53,11 +53,11 @@ function fixDurationOrRemux(inputPath, durationMs) {
|
||||
const outBuf = fixWebmDurationBuffer(inBuf, Number(durationMs));
|
||||
if (outBuf && outBuf.length) {
|
||||
fs.writeFileSync(inputPath, outBuf);
|
||||
log.info('No ffmpeg detected fixWebmDurationBuffer - true');
|
||||
log.debug('No ffmpeg detected fixWebmDurationBuffer - true');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
log.info('No ffmpeg detected fixWebmDurationBuffer - false');
|
||||
log.debug('No ffmpeg detected fixWebmDurationBuffer - false');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class RtmpFile {
|
||||
'-f flv', // Output format
|
||||
])
|
||||
.output(rtmpUrl)
|
||||
.on('start', (commandLine) => log.info('ffmpeg process starting with command:', commandLine))
|
||||
.on('start', (commandLine) => log.debug('ffmpeg process starting with command:', commandLine))
|
||||
.on('progress', (progress) => {
|
||||
/* log.debug('Processing', progress); */
|
||||
})
|
||||
@@ -49,13 +49,13 @@ class RtmpFile {
|
||||
}
|
||||
})
|
||||
.on('end', () => {
|
||||
log.info('FFmpeg processing finished');
|
||||
log.debug('FFmpeg processing finished');
|
||||
this.ffmpegProcess = null;
|
||||
this.handleEnd();
|
||||
})
|
||||
.run();
|
||||
|
||||
log.info('RtmpFile started', rtmpUrl);
|
||||
log.debug('RtmpFile started', rtmpUrl);
|
||||
return true;
|
||||
} catch (error) {
|
||||
log.error('Error starting RtmpFile', error.message);
|
||||
@@ -68,7 +68,7 @@ class RtmpFile {
|
||||
try {
|
||||
this.ffmpegProcess.kill('SIGTERM');
|
||||
this.ffmpegProcess = null;
|
||||
log.info('RtmpFile stopped');
|
||||
log.debug('RtmpFile stopped');
|
||||
return true;
|
||||
} catch (error) {
|
||||
log.error('Error stopping RtmpFile', error.message);
|
||||
|
||||
@@ -31,7 +31,7 @@ class RtmpStreamer {
|
||||
.audioBitrate('128k')
|
||||
.outputOptions(['-f flv'])
|
||||
.output(this.rtmpUrl)
|
||||
.on('start', (commandLine) => this.log.info('ffmpeg command', { id: this.rtmpKey, cmd: commandLine }))
|
||||
.on('start', (commandLine) => this.log.debug('ffmpeg command', { id: this.rtmpKey, cmd: commandLine }))
|
||||
.on('progress', (progress) => {
|
||||
/* log.debug('Processing', progress); */
|
||||
})
|
||||
@@ -42,7 +42,7 @@ class RtmpStreamer {
|
||||
this.end();
|
||||
})
|
||||
.on('end', () => {
|
||||
this.log.info('FFmpeg process ended', this.rtmpKey);
|
||||
this.log.debug('FFmpeg process ended', this.rtmpKey);
|
||||
this.end();
|
||||
})
|
||||
.run();
|
||||
@@ -60,12 +60,12 @@ class RtmpStreamer {
|
||||
if (this.stream) {
|
||||
this.stream.end();
|
||||
this.stream = null;
|
||||
this.log.info('RTMP streaming stopped', this.rtmpKey);
|
||||
this.log.debug('RTMP streaming stopped', this.rtmpKey);
|
||||
}
|
||||
if (this.ffmpegStream && !this.ffmpegStream.killed) {
|
||||
this.ffmpegStream.kill('SIGTERM');
|
||||
this.ffmpegStream = null;
|
||||
this.log.info('FFMPEG closed successfully', this.rtmpKey);
|
||||
this.log.debug('FFMPEG closed successfully', this.rtmpKey);
|
||||
}
|
||||
this.run = false;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class RtmpUrl {
|
||||
.size('1280x720') // Scale video to 1280x720 resolution
|
||||
.format('flv') // Set output format to FLV
|
||||
.output(rtmpUrl)
|
||||
.on('start', (commandLine) => log.info('ffmpeg process starting with command:', commandLine))
|
||||
.on('start', (commandLine) => log.debug('ffmpeg process starting with command:', commandLine))
|
||||
.on('progress', (progress) => {
|
||||
/* log.debug('Processing', progress); */
|
||||
})
|
||||
@@ -45,13 +45,13 @@ class RtmpUrl {
|
||||
}
|
||||
})
|
||||
.on('end', () => {
|
||||
log.info('FFmpeg processing finished');
|
||||
log.debug('FFmpeg processing finished');
|
||||
this.ffmpegProcess = null;
|
||||
this.handleEnd();
|
||||
})
|
||||
.run();
|
||||
|
||||
log.info('RtmpUrl started', rtmpUrl);
|
||||
log.debug('RtmpUrl started', rtmpUrl);
|
||||
return true;
|
||||
} catch (error) {
|
||||
log.error('Error starting RtmpUrl', error.message);
|
||||
@@ -64,7 +64,7 @@ class RtmpUrl {
|
||||
try {
|
||||
this.ffmpegProcess.kill('SIGTERM');
|
||||
this.ffmpegProcess = null;
|
||||
log.info('RtmpUrl stopped');
|
||||
log.debug('RtmpUrl stopped');
|
||||
return true;
|
||||
} catch (error) {
|
||||
log.error('Error stopping RtmpUrl', error.message);
|
||||
|
||||
@@ -3487,11 +3487,11 @@ function startServer() {
|
||||
|
||||
const activeRooms = getActiveRooms();
|
||||
|
||||
log.info('[Disconnect] - Last peer - current active rooms', activeRooms);
|
||||
log.debug('[Disconnect] - Last peer - current active rooms', activeRooms);
|
||||
|
||||
const activeStreams = getRTMPActiveStreams();
|
||||
|
||||
log.info('[Disconnect] - Last peer - current active RTMP streams', activeStreams);
|
||||
log.debug('[Disconnect] - Last peer - current active RTMP streams', activeStreams);
|
||||
}
|
||||
|
||||
removeIP(socket);
|
||||
@@ -3546,11 +3546,11 @@ function startServer() {
|
||||
|
||||
const activeRooms = getActiveRooms();
|
||||
|
||||
log.info('[REMOVE ME] - Last peer - current active rooms', activeRooms);
|
||||
log.debug('[REMOVE ME] - Last peer - current active rooms', activeRooms);
|
||||
|
||||
const activeStreams = getRTMPActiveStreams();
|
||||
|
||||
log.info('[REMOVE ME] - Last peer - current active RTMP streams', activeStreams);
|
||||
log.debug('[REMOVE ME] - Last peer - current active RTMP streams', activeStreams);
|
||||
}
|
||||
|
||||
removeIP(socket);
|
||||
@@ -3681,12 +3681,12 @@ function startServer() {
|
||||
if (room.isRtmpFileStreamerActive()) {
|
||||
room.stopRTMP();
|
||||
rtmpFileStreamsCount--;
|
||||
log.info('[REMOVE ME] - Stop RTMP Stream From FIle', rtmpFileStreamsCount);
|
||||
log.debug('[REMOVE ME] - Stop RTMP Stream From FIle', rtmpFileStreamsCount);
|
||||
}
|
||||
if (room.isRtmpUrlStreamerActive()) {
|
||||
room.stopRTMPfromURL();
|
||||
rtmpUrlStreamsCount--;
|
||||
log.info('[REMOVE ME] - Stop RTMP Stream From URL', rtmpUrlStreamsCount);
|
||||
log.debug('[REMOVE ME] - Stop RTMP Stream From URL', rtmpUrlStreamsCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ const transport = nodemailer.createTransport({
|
||||
function sendEmailAlert(event, data) {
|
||||
if (!EMAIL_ALERT || !EMAIL_HOST || !EMAIL_PORT || !EMAIL_USERNAME || !EMAIL_PASSWORD || !EMAIL_SEND_TO) return;
|
||||
|
||||
log.info('sendEMailAlert', {
|
||||
log.debug('sendEMailAlert', {
|
||||
event: event,
|
||||
data: data,
|
||||
});
|
||||
@@ -88,7 +88,7 @@ function sendEmailAlert(event, data) {
|
||||
function sendEmailNotifications(event, data, notifications) {
|
||||
if (!EMAIL_NOTIFY || !EMAIL_HOST || !EMAIL_PORT || !EMAIL_USERNAME || !EMAIL_PASSWORD) return;
|
||||
|
||||
log.info('sendEmailNotifications', {
|
||||
log.debug('sendEmailNotifications', {
|
||||
event: event,
|
||||
data: data,
|
||||
notifications: notifications,
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم