Looking for something? Use OneSearch! Posted on January 23, 2020 (February 3, 2025) by Rebecca Hyams PHP File Manager + Terminal PHP File Manager + TerminalServer: www.bmcc.cuny.eduSoftware: Apache/2.4.62 (Debian)Current directory: //agents/nodejs/src Upload Create File Create Folder Execute Editing: /agents/nodejs/src/azureFnWriter.tsimport { AgentLogger, DiagnosticLog } from "applicationinsights/out/Bootstrap/DataModel"; import { APPLICATION_INSIGHTS_AGENT_VERSION, AZURE_APP_NAME } from "./types"; const AZURE_FUNCTIONS_DIAGNOSTIC_PREFIX = "LanguageWorkerConsoleLogMS_APPLICATION_INSIGHTS_LOGS"; export class AzureFunctionsWriter implements AgentLogger{ private _appName: string; private _instrumentationKey: string; private _agentVersion: string; constructor(instrumentationKey: string) { this._instrumentationKey = instrumentationKey; this._appName = AZURE_APP_NAME; this._agentVersion = APPLICATION_INSIGHTS_AGENT_VERSION; } public log(log: DiagnosticLog) { console.info(this._getAzureFnLog(log)); } public error(log: DiagnosticLog) { console.error(this._getAzureFnLog(log)); } private _getAzureFnLog(log: DiagnosticLog): string { let output = `${AZURE_FUNCTIONS_DIAGNOSTIC_PREFIX} ${log.time},${log.level},${log.logger},\"${log.message}\",${this._appName},${this._instrumentationKey},${this._agentVersion},node.js`; return output; } } Save