Skip to content

Commit

Permalink
disable appinsights.js
Browse files Browse the repository at this point in the history
  • Loading branch information
chsami committed Sep 17, 2024
1 parent c6798b4 commit 8b4bd53
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libs/logger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const fs = require('fs');
const path = require('path');
const os = require('os');
const {appInsights} = require("./appinsights");
const {microbotDir} = require("./dir-module");

// Determine the log file path
Expand All @@ -13,7 +12,7 @@ function logMessage(message) {
fs.writeFileSync(logFilePath, '', 'utf8');
}
const logEntry = `${new Date().toISOString()} - ${message}\n`;
appInsights.defaultClient.trackTrace({ message: message, severity: 1});
// appInsights.defaultClient.trackTrace({ message: message, severity: 1});
fs.appendFile(logFilePath, logEntry, (err) => {
if (err) {
console.error('Failed to write to log file:', err);
Expand All @@ -25,7 +24,7 @@ function logError(message) {
fs.writeFileSync(logFilePath, '', 'utf8');
}
const logEntry = `${new Date().toISOString()} - ${message}\n`;
appInsights.defaultClient.trackException({ exception: new Error(message) });
// appInsights.defaultClient.trackException({ exception: new Error(message) });
fs.appendFile(logFilePath, logEntry, (err) => {
if (err) {
console.error('Failed to write to log file:', err);
Expand Down

0 comments on commit 8b4bd53

Please sign in to comment.