Socket
Socket
Sign inDemoInstall

@google-cloud/logging

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/logging - npm Package Compare versions

Comparing version 10.1.11 to 10.2.0

5

build/src/log.d.ts

@@ -50,2 +50,3 @@ /*!

defaultWriteDeleteCallback?: ApiResponseCallback;
partialSuccess?: boolean;
}

@@ -82,2 +83,5 @@ export declare type Metadata = any;

* can serve as global callback handler, which for example could be used to catch all errors and eliminate crashes.
* @param {boolean} [options.partialSuccess] Global flag indicating Whether a batch's valid entries should be written even if
* some other entry failed due to errors. Default is true.
* See {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write#body.request_body.FIELDS.partial_success|partialSuccess} for more info.
* @example

@@ -110,2 +114,3 @@ * ```

defaultWriteDeleteCallback?: ApiResponseCallback;
partialSuccess: boolean;
constructor(logging: Logging, name: string, options?: LogOptions);

@@ -112,0 +117,0 @@ /**

21

build/src/log.js

@@ -49,2 +49,5 @@ "use strict";

* can serve as global callback handler, which for example could be used to catch all errors and eliminate crashes.
* @param {boolean} [options.partialSuccess] Global flag indicating Whether a batch's valid entries should be written even if
* some other entry failed due to errors. Default is true.
* See {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write#body.request_body.FIELDS.partial_success|partialSuccess} for more info.
* @example

@@ -71,2 +74,3 @@ * ```

constructor(logging, name, options) {
var _a;
options = options || {};

@@ -109,2 +113,8 @@ this.formattedName_ = (0, log_common_1.formatLogName)(logging.projectId, name);

this.defaultWriteDeleteCallback = options.defaultWriteDeleteCallback;
/**
Turning partialSuccess by default to be true if not provided in options. This should improve
overall logging reliability since only oversized entries will be dropped
from request. See {@link https://cloud.google.com/logging/quotas#log-limits} for more info
*/
this.partialSuccess = (_a = options.partialSuccess) !== null && _a !== void 0 ? _a : true;
}

@@ -260,3 +270,3 @@ alert(entry, options) {

async write(entry, opts) {
var _a, _b;
var _a, _b, _c;
const options = opts ? opts : {};

@@ -270,5 +280,6 @@ // Extract projectId & resource from Logging - inject & memoize if not.

const decoratedEntries = this.decorateEntries(info[0]);
// If instrumentation info was added make sure we set partialSuccess, so entire
// request will make it through and only oversized entries will be dropped if any
if (info[1]) {
// If instrumentation info was added or this.partialSuccess was set, make sure we set
// partialSuccess in outgoing write request, so entire request will make it through and
// only oversized entries will be dropped if any
if (info[1] || ((_a = options.partialSuccess) !== null && _a !== void 0 ? _a : this.partialSuccess)) {
options.partialSuccess = true;

@@ -285,3 +296,3 @@ }

// Propagate maxRetries properly into writeLogEntries call
if (!((_a = options.gaxOptions) === null || _a === void 0 ? void 0 : _a.maxRetries) && ((_b = this.logging.options) === null || _b === void 0 ? void 0 : _b.maxRetries)) {
if (!((_b = options.gaxOptions) === null || _b === void 0 ? void 0 : _b.maxRetries) && ((_c = this.logging.options) === null || _c === void 0 ? void 0 : _c.maxRetries)) {
options.gaxOptions = extend({

@@ -288,0 +299,0 @@ maxRetries: this.logging.options.maxRetries,

{
"name": "@google-cloud/logging",
"version": "10.1.11",
"version": "10.2.0",
"description": "Cloud Logging Client Library for Node.js",

@@ -70,3 +70,3 @@ "keywords": [

"@types/mocha": "^9.0.0",
"@types/node": "^16.0.0",
"@types/node": "^18.0.0",
"@types/on-finished": "^2.3.1",

@@ -73,0 +73,0 @@ "@types/proxyquire": "^1.3.28",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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