pino-cloud-logging
Advanced tools
Comparing version 1.0.3 to 1.0.5
# Changelog | ||
## [1.0.5](https://github.com/cobraz/pino-cloud-logging/compare/v1.0.4...v1.0.5) (2022-06-13) | ||
### Miscellaneous Chores | ||
* release 1.0.5 ([cdb5bb5](https://github.com/cobraz/pino-cloud-logging/commit/cdb5bb5e255c814c3567be5f73cf4079e58ce6df)) | ||
## [1.0.4](https://github.com/cobraz/pino-cloud-logging/compare/v1.0.3...v1.0.4) (2022-06-13) | ||
### Bug Fixes | ||
* remove logFormat ([43b4fd0](https://github.com/cobraz/pino-cloud-logging/commit/43b4fd0e6ca14f3723480d634bd605037abb66a0)) | ||
## [1.0.3](https://github.com/cobraz/pino-cloud-logging/compare/v1.0.2...v1.0.3) (2022-06-13) | ||
@@ -4,0 +18,0 @@ |
@@ -6,4 +6,3 @@ import { LoggerOptions } from 'pino'; | ||
mixin?: (mergeObject: object, level: number) => object; | ||
logFormat?: 'text' | 'json'; | ||
} | ||
export declare function gcpLogOptions(options?: LoggerOptions, context?: ServiceContext): LoggerOptions; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.gcpLogOptions = void 0; | ||
const pino_1 = require("pino"); | ||
// Map Pino levels to Google Cloud Logging severity levels | ||
@@ -16,4 +15,3 @@ // https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity | ||
function gcpLogOptions(options, context = {}) { | ||
const { mixin, serviceName, version, logFormat = 'json' } = context; | ||
const prettyPrint = logFormat === 'text'; | ||
const { mixin, serviceName, version } = context; | ||
return { | ||
@@ -44,6 +42,2 @@ // https://cloud.google.com/error-reporting/docs/formatting-error-messages#json_representation | ||
messageKey: 'message', | ||
prettyPrint, | ||
timestamp: prettyPrint | ||
? pino_1.stdTimeFunctions.isoTime | ||
: () => `,"eventTime":${Date.now() / 1000.0}`, | ||
...options, | ||
@@ -50,0 +44,0 @@ }; |
{ | ||
"name": "pino-cloud-logging", | ||
"main": "dist/main.js", | ||
"version": "1.0.5", | ||
"keywords": [ | ||
@@ -10,7 +10,20 @@ "google", | ||
"pino-config", | ||
"google-cloud-logger" | ||
"google-cloud-logger", | ||
"gcp", | ||
"gcr", | ||
"gcp-log", | ||
"gcp-logger" | ||
], | ||
"repository": "github:cobraz/pino-cloud-logging", | ||
"license": "Apache-2.0", | ||
"main": "dist/main.js", | ||
"files": [ | ||
"dist/*" | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"dev": "tsnd --respawn src/main.ts", | ||
"lint": "eslint . --ext .ts,.tsx", | ||
"test": "jest --coverage src/**/*" | ||
}, | ||
"prettier": "@cobraz/prettier", | ||
@@ -20,8 +33,2 @@ "eslintConfig": { | ||
}, | ||
"scripts": { | ||
"dev": "tsnd --respawn src/main.ts", | ||
"lint": "eslint . --ext .ts,.tsx", | ||
"test": "jest --coverage src/**/*", | ||
"build": "tsc" | ||
}, | ||
"dependencies": { | ||
@@ -41,5 +48,3 @@ "pino": "^8.0.0" | ||
"typescript": "^4.5.4" | ||
}, | ||
"license": "Apache-2.0", | ||
"version": "1.0.3" | ||
} | ||
} |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
17344
51