Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@valora/logging

Package Overview
Dependencies
Maintainers
9
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@valora/logging - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

3

dist/logging.d.ts

@@ -12,7 +12,8 @@ import Logger, { LogLevel } from 'bunyan';

}): Logger;
export declare function createLoggingMiddleware({ projectId, logger, }: {
export declare function createLoggingMiddleware({ projectId, logger, excludeHttpRequestField, }: {
projectId: string;
logger: Logger;
excludeHttpRequestField?: boolean;
}): (req: ServerRequest, res: ServerResponse, next: Function) => void;
export declare function createDetailedRequestSerializers(): Logger.Serializers;
export {};

@@ -75,4 +75,4 @@ "use strict";

// This logs the request and response objects for all requests.
// It also shows nicely formatted request logs for Cloud Functions in Logs Explorer (App Engine does this automatically).
function createLoggingMiddleware({ projectId, logger, }) {
// It also shows nicely formatted request log in Logs Explorer.
function createLoggingMiddleware({ projectId, logger, excludeHttpRequestField, }) {
function makeChildLogger(trace, span) {

@@ -84,2 +84,3 @@ return logger.child({ [logging_bunyan_1.LOGGING_TRACE_KEY]: trace, [logging_bunyan_1.LOGGING_SPAN_KEY]: span }, true /* simple child */);

const { requestUrl } = httpRequest;
const googleServiceName = getGoogleServiceName();
const cloudFunctionName = process.env.K_SERVICE;

@@ -91,6 +92,3 @@ logger.info({

res,
// Note: Contrary to what the documentation says for `makeMiddleware`,
// Cloud Functions (at least the gen1 version we use) doesn't already log the httpRequest
// So we do it ourselves
...(cloudFunctionName
...(googleServiceName && !excludeHttpRequestField
? {

@@ -104,3 +102,4 @@ // This shows the nicely formatted request log in Logs Explorer.

// from the summary line which are otherwise present when httpRequest is not set
requestUrl: requestUrl?.startsWith('/') &&
requestUrl: cloudFunctionName &&
requestUrl?.startsWith('/') &&
!requestUrl.startsWith(`/${cloudFunctionName}`)

@@ -107,0 +106,0 @@ ? `/${cloudFunctionName}${requestUrl}`

{
"name": "@valora/logging",
"version": "1.1.1",
"version": "1.2.0",
"main": "dist/logging.js",

@@ -5,0 +5,0 @@ "typings": "dist/logging.d.ts",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc