You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

gcp-structured-logger

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gcp-structured-logger - npm Package Compare versions

Comparing version

to
1.4.9

6

index.d.ts

@@ -23,2 +23,8 @@ /// <reference types="express-serve-static-core" />

}
export interface TraceContext {
/** Format `projects/<PROJECT-ID>/traces/<TRACE-ID>`. */
trace: string;
spanId: string;
traceSampled: boolean;
}
/** @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry */

@@ -25,0 +31,0 @@ export interface LogEntry {

2

package.json
{
"name": "gcp-structured-logger",
"version": "1.4.8",
"version": "1.4.9",
"description": "Structured logger for GCP logging",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -486,3 +486,3 @@ const { format, formatWithOptions, inspect } = require('util')

/** @readonly @private */
this._trace = extractTraceContext(projectId, request)
this._trace = extractTraceContext(projectId, request) ?? {}
}

@@ -489,0 +489,0 @@

@@ -15,6 +15,5 @@ const { getHeader } = require('./request-properties')

/**
* @typedef {{ trace: string, spanId: string, traceSampled: boolean }} TraceContext
* @param {string} projectId
* @param {import('./StructuredLogger').Request} req
* @returns {{} | TraceContext}
* @returns {import('../').TraceContext | undefined}
*/

@@ -45,3 +44,3 @@ function extractTraceContext(projectId, req) {

// Can ignore - invalid values
return {}
return
}

@@ -48,0 +47,0 @@ return { trace: `projects/${projectId}/traces/${traceId}`, spanId: spanId.toString(16).padStart(16, '0'), traceSampled: Boolean(flagsValue & TRACE_PARENT_FLAGS.sampled) }