smartlog-destination-devtools/dist/browsertest.d8c67eb9.map
2018-11-13 01:32:39 +01:00

1 line
7.5 KiB
Plaintext

{"version":3,"sources":["../ts/smartlog.classes.logrouter.ts","../ts/smartlog.classes.smartlog.ts","../ts/index.ts","browsertest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAa,SAAS;IAMpB;QALA;;WAEG;QACK,oBAAe,GAAsB,EAAE,CAAC;IAEjC,CAAC;IAET,iBAAiB,CAAC,cAA+B;QACtD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;IAED,oDAAoD;IACpD,QAAQ,CAAC,aAA0B;QACjC,KAAK,MAAM,cAAc,IAAI,IAAI,CAAC,eAAe,EAAE;YACjD,cAAc,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;SACzC;IACH,CAAC;CACF;AAlBD,8BAkBC;;;;;ACjBD,6EAAyD;AAOzD,MAAa,QAAQ;IAYnB,YAAY,UAAsC;QAN1C,cAAS,GAAG,IAAI,sCAAS,EAAE,CAAC;QAOlC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;IACpD,CAAC;IAPM,iBAAiB,CAAE,iBAAkC;QAC1D,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACtD,CAAC;IAQD,eAAe;IACf,eAAe;IACf,eAAe;IAEf;;OAEG;IACH,aAAa;QACX,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB;;;;;OAKG;IACI,GAAG,CAAC,WAAsB,EAAE,aAAqB,EAAE,UAAgB;QACxE,IAA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;AAEA,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAxB;AACA,IAAM,UAAU,GAAgB;AAC9B,EAAA,OAAO,EAAE,eADqB;AAE9B,EAAA,WAAW,EAAE,gBAFiB;AAG9B,EAAA,aAAa,EAAE,eAHe;AAI9B,EAAA,WAAW,EAAE,SAJiB;AAK9B,EAAA,OAAO,EAAE,QALqB;AAM9B,EAAA,IAAI,EAAE;AANwB,CAAhC,EASA;;AACA,IAAA,2BAAA,GAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,CAAA;;AAEA,IAAM,eAAe,GAAG,IAAI,2BAA2B,CAAC,2BAAhC,EAAxB;AAEA,eAAe,CAAC,SAAhB,CAA0B;AACxB,EAAA,SAAS,EAAE,IAAI,CAAC,GAAL,EADa;AAExB,EAAA,IAAI,EAAE,KAFkB;AAGxB,EAAA,OAAO,EAAE,UAHe;AAIxB,EAAA,KAAK,EAAE,MAJiB;AAKxB,EAAA,OAAO,EAAE;AALe,CAA1B","file":"browsertest.d8c67eb9.map","sourceRoot":"../test","sourcesContent":["import * as plugins from './smartlog.plugins';\n\nimport { ILogDestination, ILogPackage } from '@pushrocks/smartlog-interfaces';\n\nexport class LogRouter {\n /**\n * all log destinations\n */\n private logDestinations: ILogDestination[] = [];\n\n constructor() {}\n\n public addLogDestination(logDestination: ILogDestination) {\n this.logDestinations.push(logDestination);\n }\n\n // routes the log according to added logDestinations\n routeLog(logPackageArg: ILogPackage) {\n for (const logDestination of this.logDestinations) {\n logDestination.handleLog(logPackageArg);\n }\n }\n}\n","import * as plugins from './smartlog.plugins';\n\n// interfaces\nimport { TLogType, TEnvironment, ILogContext, TLogLevel, TRuntime, ILogDestination, ILogPackage } from '@pushrocks/smartlog-interfaces';\n\nimport { LogRouter } from './smartlog.classes.logrouter';\n\nexport interface ISmartlogContructorOptions {\n logContext: ILogContext;\n minimumLogLevel?: TLogLevel;\n}\n\nexport class Smartlog {\n private logContext: ILogContext;\n private minimumLogLevel: TLogLevel;\n \n private consoleEnabled: boolean;\n \n private logRouter = new LogRouter();\n\n public addLogDestination (logDestinationArg: ILogDestination) {\n this.logRouter.addLogDestination(logDestinationArg);\n }\n\n constructor(optionsArg: ISmartlogContructorOptions) {\n this.logContext = optionsArg.logContext;\n this.minimumLogLevel = optionsArg.minimumLogLevel;\n }\n\n\n // ============\n // Logger Setup\n // ============\n\n /**\n * enables console logging\n */\n enableConsole() {\n this.consoleEnabled = true;\n }\n\n // =============\n // log functions\n // =============\n /**\n * main log method\n * @param logLevelArg - the log level\n * @param logMessageArg - the log message\n * @param logDataArg - any additional log data\n */\n public log(logLevelArg: TLogLevel, logMessageArg: string, logDataArg?: any) {\n if (this.consoleEnabled) {\n console.log(`LOG: ${logLevelArg}: ${logMessageArg}`);\n }\n const logPackage: ILogPackage = {\n timestamp: Date.now(),\n type: 'log',\n context: this.logContext,\n level: logLevelArg,\n message: logMessageArg\n };\n if(logDataArg) {\n logPackage.data = logDataArg;\n }\n this.logRouter.routeLog(logPackage);\n }\n\n public increment(logLevelArg: TLogLevel, logMessageArg) {\n if (this.consoleEnabled) {\n console.log(`INCREMENT: ${logLevelArg}: ${logMessageArg}`);\n }\n this.logRouter.routeLog({\n timestamp: Date.now(),\n type: 'increment',\n context: this.logContext,\n level: logLevelArg,\n message: logMessageArg\n });\n }\n\n public handleLogPackage(logPackageArg: ILogPackage) {\n this.logRouter.routeLog(logPackageArg);\n }\n}\n","import * as plugins from './smartlog.plugins';\nimport { Smartlog } from './smartlog.classes.smartlog';\nconst defaultLogger: Smartlog = new Smartlog({\n logContext: {\n company: 'undefined',\n companyunit: 'undefefined',\n containerName: 'undefined',\n environment: 'local',\n runtime: 'node',\n zone: 'undefined'\n }\n});\n\nexport { Smartlog, defaultLogger };\n","// preparation\nimport { ILogContext } from '@pushrocks/smartlog-interfaces';\nimport * as smartlog from '@pushrocks/smartlog';\n\nconst logger = smartlog.defaultLogger;\nconst logContext: ILogContext = {\n company: 'Lossless GmbH',\n companyunit: 'Lossless.Cloud',\n containerName: 'testContainer',\n environment: 'staging',\n runtime: 'chrome',\n zone: 'servezone'\n};\n\n// import the module to test\nimport * as smartlogDestinationDevtools from '../ts/index';\n\nconst testDestination = new smartlogDestinationDevtools.SmartlogDestinationDevtools();\n\ntestDestination.handleLog({\n timestamp: Date.now(),\n type: 'log',\n context: logContext,\n level: 'info',\n message: 'wait, what? Hi, this is a message!'\n});\n"]}