@aspecto/logger
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -9,3 +9,3 @@ "use strict"; | ||
}; | ||
var _a, _b; | ||
var _a, _b, _c; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -15,6 +15,10 @@ const os = __importStar(require("os")); | ||
const types_1 = require("./types"); | ||
const api_1 = require("@opentelemetry/api"); | ||
let getContext; | ||
try { | ||
getContext = (_a = require('@aspecto/opentelemetry')) === null || _a === void 0 ? void 0 : _a.getContext; | ||
} | ||
catch (_d) { } | ||
const packageJson = require(`${process.cwd()}/package.json`); | ||
const metadata = { | ||
env: (_b = (_a = process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV, | ||
env: (_c = (_b = process) === null || _b === void 0 ? void 0 : _b.env) === null || _c === void 0 ? void 0 : _c.NODE_ENV, | ||
appName: packageJson.name, | ||
@@ -54,3 +58,3 @@ appVersion: packageJson.version, | ||
const productionLogger = (level, outputAs, message, extra) => { | ||
var _a, _b, _c, _d; | ||
var _a, _b; | ||
if (level === types_1.LogLevel.Debug || level === types_1.LogLevel.Trace) | ||
@@ -60,5 +64,5 @@ return; | ||
try { | ||
contextTraceId = (_d = (_c = (_b = (_a = api_1.trace) === null || _a === void 0 ? void 0 : _a.getTracer(metadata.appName)) === null || _b === void 0 ? void 0 : _b.getCurrentSpan()) === null || _c === void 0 ? void 0 : _c.context()) === null || _d === void 0 ? void 0 : _d.traceId; | ||
contextTraceId = (_b = (_a = getContext) === null || _a === void 0 ? void 0 : _a()) === null || _b === void 0 ? void 0 : _b.traceId; | ||
} | ||
catch (_e) { } | ||
catch (_c) { } | ||
const log = { | ||
@@ -65,0 +69,0 @@ level, |
{ | ||
"name": "@aspecto/logger", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "", | ||
@@ -19,3 +19,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@opentelemetry/api": "^0.12.0", | ||
"@aspecto/opentelemetry": "^0.0.92", | ||
"@types/jest": "^25.1.1", | ||
@@ -22,0 +22,0 @@ "@types/node": "^13.1.2", |
Sorry, the diff of this file is not supported yet
223
15269