@aspecto/logger
Advanced tools
Comparing version
@@ -19,9 +19,16 @@ "use strict"; | ||
catch (_d) { } | ||
const packageJson = require(`${process.cwd()}/package.json`); | ||
const metadata = { | ||
env: (_c = (_b = process) === null || _b === void 0 ? void 0 : _b.env) === null || _c === void 0 ? void 0 : _c.NODE_ENV, | ||
appName: packageJson.name, | ||
appVersion: packageJson.version, | ||
hostname: os.hostname(), | ||
}; | ||
try { | ||
const packageJson = require(`${process.cwd()}/package.json`); | ||
if (packageJson.version) { | ||
metadata['appVersion'] = packageJson.version; | ||
} | ||
if (packageJson.name) { | ||
metadata['appName'] = packageJson.name; | ||
} | ||
} | ||
catch (_e) { } | ||
const trySerialize = (val) => { | ||
@@ -52,3 +59,3 @@ try { | ||
host: (_c = request) === null || _c === void 0 ? void 0 : _c.host, | ||
path: (_d = request) === null || _d === void 0 ? void 0 : _d.path | ||
path: (_d = request) === null || _d === void 0 ? void 0 : _d.path, | ||
}, | ||
@@ -58,3 +65,3 @@ response: { | ||
statusText: (_f = response) === null || _f === void 0 ? void 0 : _f.statusText, | ||
} | ||
}, | ||
}; | ||
@@ -75,3 +82,3 @@ }; | ||
metadata, | ||
contextTraceId | ||
contextTraceId, | ||
}; | ||
@@ -78,0 +85,0 @@ if (extra instanceof Error) { |
{ | ||
"name": "@aspecto/logger", | ||
"version": "0.0.12", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"private": false, | ||
"scripts": { | ||
"test": "jest", | ||
"build": "tsc", | ||
"prepublishOnly": "rm -rf dist && yarn && yarn build" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"serialize-error": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"@aspecto/opentelemetry": "^0.0.92", | ||
"@types/jest": "^25.1.1", | ||
"@types/node": "^13.1.2", | ||
"husky": "^3.1.0", | ||
"jest": "^25.1.0", | ||
"ts-jest": "^25.1.0", | ||
"typescript": "^3.7.4" | ||
}, | ||
"jest": { | ||
"preset": "ts-jest", | ||
"testMatch": [ | ||
"**/__tests__/**/*.spec.+(ts|tsx|js)" | ||
], | ||
"globals": { | ||
"ts-jest": { | ||
"diagnostics": false | ||
} | ||
} | ||
} | ||
"name": "@aspecto/logger", | ||
"version": "0.0.13", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"private": false, | ||
"scripts": { | ||
"test": "jest", | ||
"build": "tsc", | ||
"watch": "tsc -w", | ||
"prepublishOnly": "rm -rf dist && yarn && yarn build", | ||
"prettier": "prettier --write \"src/*\"" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"serialize-error": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"@aspecto/opentelemetry": "^0.0.92", | ||
"@aspecto/prettier-config": "^0.0.1", | ||
"@types/jest": "^25.1.1", | ||
"@types/node": "^13.1.2", | ||
"husky": "^3.1.0", | ||
"jest": "^25.1.0", | ||
"prettier": "^2.2.1", | ||
"ts-jest": "^25.1.0", | ||
"typescript": "^3.7.4" | ||
}, | ||
"jest": { | ||
"preset": "ts-jest", | ||
"testMatch": [ | ||
"**/__tests__/**/*.spec.+(ts|tsx|js)" | ||
], | ||
"globals": { | ||
"ts-jest": { | ||
"diagnostics": false | ||
} | ||
} | ||
}, | ||
"prettier": "@aspecto/prettier-config" | ||
} |
@@ -6,2 +6,3 @@ # Aspecto logger | ||
#### Install via NPM | ||
``` | ||
@@ -12,2 +13,3 @@ yarn add @aspecto/logger | ||
#### Typescript Usage | ||
``` | ||
@@ -18,4 +20,5 @@ import logger from '@aspecto/logger'; | ||
#### JS Usage | ||
``` | ||
const logger = require('@aspecto/logger').default; | ||
``` |
{ | ||
"extends": [ | ||
"github>aspecto-io/renovate-config" | ||
] | ||
"extends": ["github>aspecto-io/renovate-config"] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16397
5.34%232
2.2%22
15.79%9
28.57%