diff --git a/server/src/config.ts b/server/src/config.ts index 6c3f573..9df28f4 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -64,7 +64,7 @@ function getPackageVersion() { let packageJson: any = getJsonDataSync(packageFile); return packageJson.version; } else { - console.debug(`Can't find package file ${packageFile}`); + console.log(`Can't find package file ${packageFile}`); return null; } } diff --git a/server/src/controllers/analytics_controller.ts b/server/src/controllers/analytics_controller.ts index 894ba1d..e3c1b26 100644 --- a/server/src/controllers/analytics_controller.ts +++ b/server/src/controllers/analytics_controller.ts @@ -117,7 +117,7 @@ async function query(analyticUnit: AnalyticUnit.AnalyticUnit, detector: Analytic to: now }; } - console.debug(`query time range: from ${new Date(range.from)} to ${new Date(range.to)}`); + console.log(`query time range: from ${new Date(range.from)} to ${new Date(range.to)}`); let panelUrl; if(GRAFANA_URL !== null) { @@ -160,7 +160,7 @@ function getQueryRangeForLearningBySegments(segments: Segment.Segment[]) { } export async function runLearning(id: AnalyticUnit.AnalyticUnitId) { - console.debug('learning started...'); + console.log('learning started...'); try { let analyticUnit = await AnalyticUnit.findById(id); @@ -206,7 +206,7 @@ export async function runLearning(id: AnalyticUnit.AnalyticUnitId) { id, AnalyticsTaskType.LEARN, taskPayload ); AnalyticUnit.setStatus(id, AnalyticUnit.AnalyticUnitStatus.LEARNING); - console.debug(`run task, id:${id}`); + console.log(`run task, id:${id}`); let result = await runTask(task); if(result.status !== AnalyticUnit.AnalyticUnitStatus.SUCCESS) { throw new Error(result.error); @@ -245,7 +245,7 @@ export async function runDetect(id: AnalyticUnit.AnalyticUnitId) { AnalyticsTaskType.DETECT, { detector, analyticUnitType, lastDetectionTime: unit.lastDetectionTime, data, cache: oldCache } ); - console.debug(`run task, id:${id}`); + console.log(`run task, id:${id}`); let result = await runTask(task); if(result.status === AnalyticUnit.AnalyticUnitStatus.FAILED) { throw new Error(result.error); @@ -302,7 +302,7 @@ async function processDetectionResult(analyticUnitId: AnalyticUnit.AnalyticUnitI `Missing lastDetectionTime in result or it is corrupted: ${JSON.stringify(detectionResult)}` ); } - console.debug(`got detection result for ${analyticUnitId} with ${detectionResult.segments.length} segments`); + console.log(`got detection result for ${analyticUnitId} with ${detectionResult.segments.length} segments`); const sortedSegments: {from, to}[] = _.sortBy(detectionResult.segments, 'from'); const segments = sortedSegments.map( @@ -323,7 +323,7 @@ async function processDetectionResult(analyticUnitId: AnalyticUnit.AnalyticUnitI if(_.isEmpty(segments)) { reasons.push('segments empty'); } - console.debug(`skip sending webhook for ${analyticUnit.id}, ${reasons.join(', ')}`); + console.log(`skip sending webhook for ${analyticUnit.id}, ${reasons.join(', ')}`); } return { lastDetectionTime: detectionResult.lastDetectionTime, diff --git a/server/src/services/alert_service.ts b/server/src/services/alert_service.ts index bae8269..bb08c3b 100644 --- a/server/src/services/alert_service.ts +++ b/server/src/services/alert_service.ts @@ -44,7 +44,7 @@ class ThresholdAlert extends Alert { if(segment.from - this.lastOccurence > this.EXPIRE_PERIOD_MS) { if(this.enabled) { - console.debug(`time between threshold occurences ${segment.from - this.lastOccurence}ms, send alert`); + console.log(`time between threshold occurences ${segment.from - this.lastOccurence}ms, send alert`); sendWebhook(this.analyticUnit.name, segment); } } diff --git a/server/src/services/data_puller.ts b/server/src/services/data_puller.ts index c8df31d..adb3ae9 100644 --- a/server/src/services/data_puller.ts +++ b/server/src/services/data_puller.ts @@ -83,7 +83,7 @@ export class DataPuller { } private async _runAnalyticUnitPuller(analyticUnit: AnalyticUnit.AnalyticUnit) { - console.debug(`run data puller for analytic unit ${analyticUnit.id}`); + console.log(`run data puller for analytic unit ${analyticUnit.id}`); // TODO: lastDetectionTime can be in ns const time = analyticUnit.lastDetectionTime + 1 || Date.now(); this._unitTimes[analyticUnit.id] = time; @@ -127,7 +127,7 @@ export class DataPuller { const getData = async () => { if(!this.analyticsService.ready) { - console.debug(`data generator: analytic service not ready, return empty result while wait service`); + console.log(`data generator: analytic service not ready, return empty result while wait service`); return { columns: [], values: []