UNPKG

@dynatrace/cordova-plugin

Version:

This plugin gives you the ability to use the Dynatrace instrumentation in your hybrid application (Cordova, Ionic, ..). It uses the Mobile Agent, the JavaScript Agent. The Mobile Agent will give you all device specific values containing lifecycle informat

32 lines (31 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LogMessageBuilder = void 0; var LogLevel_1 = require("./LogLevel"); var LogUtil_1 = require("./LogUtil"); var LogMessageBuilder = (function () { function LogMessageBuilder(message) { this.message = message; this.logLevel = LogLevel_1.LogLevel.INFO; } LogMessageBuilder.prototype.setLogLevel = function (logLevel) { this.logLevel = logLevel; return this; }; LogMessageBuilder.prototype.setLogDate = function (date) { this.date = date; return this; }; LogMessageBuilder.prototype.build = function () { var stringBuilder = "#".concat(this.logLevel.toString(), " "); if (this.date === undefined) { stringBuilder += "[".concat((0, LogUtil_1.currentDate)(), "]: "); } else { stringBuilder += "[".concat((0, LogUtil_1.convertDateToString)(this.date), "]: "); } return stringBuilder += this.message; }; return LogMessageBuilder; }()); exports.LogMessageBuilder = LogMessageBuilder;